Search in sources :

Example 1 with KeyValueSerializationSchema

use of org.apache.rocketmq.flink.common.serialization.KeyValueSerializationSchema in project rocketmq-externals by apache.

the class RocketMQSinkTest method setUp.

@Before
public void setUp() throws Exception {
    KeyValueSerializationSchema serializationSchema = new SimpleKeyValueSerializationSchema("id", "name");
    TopicSelector topicSelector = new DefaultTopicSelector("tpc");
    Properties props = new Properties();
    rocketMQSink = new RocketMQSink(serializationSchema, topicSelector, props);
    producer = mock(DefaultMQProducer.class);
    setFieldValue(rocketMQSink, "producer", producer);
}
Also used : DefaultTopicSelector(org.apache.rocketmq.flink.common.selector.DefaultTopicSelector) TopicSelector(org.apache.rocketmq.flink.common.selector.TopicSelector) KeyValueSerializationSchema(org.apache.rocketmq.flink.common.serialization.KeyValueSerializationSchema) SimpleKeyValueSerializationSchema(org.apache.rocketmq.flink.common.serialization.SimpleKeyValueSerializationSchema) DefaultTopicSelector(org.apache.rocketmq.flink.common.selector.DefaultTopicSelector) SimpleKeyValueSerializationSchema(org.apache.rocketmq.flink.common.serialization.SimpleKeyValueSerializationSchema) Properties(java.util.Properties) DefaultMQProducer(org.apache.rocketmq.client.producer.DefaultMQProducer) Before(org.junit.Before)

Aggregations

Properties (java.util.Properties)1 DefaultMQProducer (org.apache.rocketmq.client.producer.DefaultMQProducer)1 DefaultTopicSelector (org.apache.rocketmq.flink.common.selector.DefaultTopicSelector)1 TopicSelector (org.apache.rocketmq.flink.common.selector.TopicSelector)1 KeyValueSerializationSchema (org.apache.rocketmq.flink.common.serialization.KeyValueSerializationSchema)1 SimpleKeyValueSerializationSchema (org.apache.rocketmq.flink.common.serialization.SimpleKeyValueSerializationSchema)1 Before (org.junit.Before)1