Search in sources :

Example 1 with KafkaTopicSelector

use of org.apache.storm.kafka.trident.selector.KafkaTopicSelector in project storm by apache.

the class TridentKafkaTest method setup.

@Before
public void setup() {
    broker = new KafkaTestBroker();
    simpleConsumer = TestUtils.getKafkaConsumer(broker);
    TridentTupleToKafkaMapper<Object, Object> mapper = new FieldNameBasedTupleToKafkaMapper<Object, Object>("key", "message");
    KafkaTopicSelector topicSelector = new DefaultTopicSelector(TestUtils.TOPIC);
    state = new TridentKafkaState().withKafkaTopicSelector(topicSelector).withTridentTupleToKafkaMapper(mapper);
    state.prepare(TestUtils.getProducerProperties(broker.getBrokerConnectionString()));
}
Also used : TridentKafkaState(org.apache.storm.kafka.trident.TridentKafkaState) KafkaTopicSelector(org.apache.storm.kafka.trident.selector.KafkaTopicSelector) DefaultTopicSelector(org.apache.storm.kafka.trident.selector.DefaultTopicSelector) FieldNameBasedTupleToKafkaMapper(org.apache.storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaMapper) Before(org.junit.Before)

Aggregations

TridentKafkaState (org.apache.storm.kafka.trident.TridentKafkaState)1 FieldNameBasedTupleToKafkaMapper (org.apache.storm.kafka.trident.mapper.FieldNameBasedTupleToKafkaMapper)1 DefaultTopicSelector (org.apache.storm.kafka.trident.selector.DefaultTopicSelector)1 KafkaTopicSelector (org.apache.storm.kafka.trident.selector.KafkaTopicSelector)1 Before (org.junit.Before)1