Update dependency versions
This commit is contained in:
@@ -74,11 +74,11 @@ public class TwoKafkaBindersApplicationTest {
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private BinderFactory<MessageChannel> binderFactory;
|
||||
private BinderFactory binderFactory;
|
||||
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
Binder<MessageChannel, ?, ?> binder1 = binderFactory.getBinder("kafka1");
|
||||
Binder<MessageChannel, ?, ?> binder1 = binderFactory.getBinder("kafka1", MessageChannel.class);
|
||||
KafkaMessageChannelBinder kafka1 = (KafkaMessageChannelBinder) binder1;
|
||||
DirectFieldAccessor directFieldAccessor1 = new DirectFieldAccessor(kafka1);
|
||||
KafkaBinderConfigurationProperties configuration1 =
|
||||
@@ -86,7 +86,7 @@ public class TwoKafkaBindersApplicationTest {
|
||||
Assert.assertThat(configuration1.getBrokers(), arrayWithSize(1));
|
||||
Assert.assertThat(configuration1.getBrokers()[0], equalTo(kafkaTestSupport1.getBrokersAsString()));
|
||||
|
||||
Binder<MessageChannel, ?, ?> binder2 = binderFactory.getBinder("kafka2");
|
||||
Binder<MessageChannel, ?, ?> binder2 = binderFactory.getBinder("kafka2", MessageChannel.class);
|
||||
KafkaMessageChannelBinder kafka2 = (KafkaMessageChannelBinder) binder2;
|
||||
DirectFieldAccessor directFieldAccessor2 = new DirectFieldAccessor(kafka2);
|
||||
KafkaBinderConfigurationProperties configuration2 =
|
||||
@@ -98,17 +98,17 @@ public class TwoKafkaBindersApplicationTest {
|
||||
@Test
|
||||
public void messagingWorks() {
|
||||
DirectChannel dataProducer = new DirectChannel();
|
||||
((KafkaMessageChannelBinder) binderFactory.getBinder("kafka1"))
|
||||
((KafkaMessageChannelBinder) binderFactory.getBinder("kafka1", MessageChannel.class))
|
||||
.bindProducer("dataIn", dataProducer, new ExtendedProducerProperties<>(new KafkaProducerProperties()));
|
||||
|
||||
QueueChannel dataConsumer = new QueueChannel();
|
||||
((KafkaMessageChannelBinder) binderFactory.getBinder("kafka2")).bindConsumer("dataOut", UUID.randomUUID().toString(),
|
||||
((KafkaMessageChannelBinder) binderFactory.getBinder("kafka2", MessageChannel.class)).bindConsumer("dataOut", UUID.randomUUID().toString(),
|
||||
dataConsumer, new ExtendedConsumerProperties<>(new KafkaConsumerProperties()));
|
||||
|
||||
String testPayload = "testFoo" + UUID.randomUUID().toString();
|
||||
dataProducer.send(MessageBuilder.withPayload(testPayload).build());
|
||||
|
||||
Message<?> receive = dataConsumer.receive(5000);
|
||||
Message<?> receive = dataConsumer.receive(60_000);
|
||||
Assert.assertThat(receive, Matchers.notNullValue());
|
||||
Assert.assertThat(receive.getPayload(), CoreMatchers.equalTo(testPayload));
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.springframework.integration.channel.DirectChannel;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.kafka.test.rule.KafkaEmbedded;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.support.MessageBuilder;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
|
||||
@@ -83,20 +84,20 @@ public class RabbitAndKafkaBinderApplicationTests {
|
||||
"--spring.cloud.stream.kafka.binder.zkNodes=" + kafkaEmbedded.getZookeeperConnectionString(),
|
||||
"--spring.cloud.stream.bindings.output.producer.requiredGroups=" + this.randomGroup);
|
||||
DirectChannel dataProducer = new DirectChannel();
|
||||
BinderFactory<?> binderFactory = context.getBean(BinderFactory.class);
|
||||
BinderFactory binderFactory = context.getBean(BinderFactory.class);
|
||||
|
||||
QueueChannel dataConsumer = new QueueChannel();
|
||||
|
||||
((RabbitMessageChannelBinder) binderFactory.getBinder("rabbit")).bindConsumer("dataOut", this.randomGroup,
|
||||
((RabbitMessageChannelBinder) binderFactory.getBinder("rabbit", MessageChannel.class)).bindConsumer("dataOut", this.randomGroup,
|
||||
dataConsumer, new ExtendedConsumerProperties<>(new RabbitConsumerProperties()));
|
||||
|
||||
((KafkaMessageChannelBinder) binderFactory.getBinder("kafka"))
|
||||
((KafkaMessageChannelBinder) binderFactory.getBinder("kafka", MessageChannel.class))
|
||||
.bindProducer("dataIn", dataProducer, new ExtendedProducerProperties<>(new KafkaProducerProperties()));
|
||||
|
||||
String testPayload = "testFoo" + this.randomGroup;
|
||||
dataProducer.send(MessageBuilder.withPayload(testPayload).build());
|
||||
|
||||
Message<?> receive = dataConsumer.receive(10000);
|
||||
Message<?> receive = dataConsumer.receive(60_000);
|
||||
Assert.assertThat(receive, Matchers.notNullValue());
|
||||
Assert.assertThat(receive.getPayload(), CoreMatchers.equalTo(testPayload));
|
||||
context.close();
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -17,7 +17,7 @@
|
||||
</parent>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<spring-cloud-stream.version>Brooklyn.BUILD-SNAPSHOT</spring-cloud-stream.version>
|
||||
<spring-cloud-stream.version>Brooklyn.SR3</spring-cloud-stream.version>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
<modules>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<dependency>
|
||||
<groupId>io.projectreactor</groupId>
|
||||
<artifactId>reactor-core</artifactId>
|
||||
<version>3.0.1.BUILD-SNAPSHOT</version>
|
||||
<version>3.0.5.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<dependency>
|
||||
<groupId>io.projectreactor</groupId>
|
||||
<artifactId>reactor-core</artifactId>
|
||||
<version>3.0.1.BUILD-SNAPSHOT</version>
|
||||
<version>3.0.5.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.reactivex</groupId>
|
||||
|
||||
Reference in New Issue
Block a user