Skip to content

Commit

Permalink
Upgrade Spring Boot to 2.0.3 and Spring Cloud to Finchley.SR2 (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gytis Trikleris authored Nov 7, 2018
1 parent 8b10a26 commit 2107748
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,103 +28,33 @@
<properties>
<main.basedir>${project.basedir}/../..</main.basedir>

<version.io.opentracing.contrib.opentracing-spring-cloud-starter>0.1.0</version.io.opentracing.contrib.opentracing-spring-cloud-starter>
<version.me.snowdrop.spring-cloud-starter-stream-artemis>1.0.0.Alpha1</version.me.snowdrop.spring-cloud-starter-stream-artemis>
<version.org.apache.activemq>2.1.0</version.org.apache.activemq>
<version.io.opentracing.contrib.opentracing-spring-cloud-jms-starter>0.2.1</version.io.opentracing.contrib.opentracing-spring-cloud-jms-starter>
<version.me.snowdrop.spring-cloud-starter-stream-artemis>0.1.0</version.me.snowdrop.spring-cloud-starter-stream-artemis>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-messaging-it-stream-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-cloud-starter</artifactId>
<version>${version.io.opentracing.contrib.opentracing-spring-cloud-starter}</version>
</dependency>
<dependency>
<groupId>me.snowdrop</groupId>
<artifactId>spring-cloud-starter-stream-artemis</artifactId>
<version>${version.me.snowdrop.spring-cloud-starter-stream-artemis}</version>
</dependency>
<!-- Override Artemis versions as the stream binder currently only works with 2.x -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-commons</artifactId>
<version>${version.org.apache.activemq}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-core-client</artifactId>
<version>${version.org.apache.activemq}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-client</artifactId>
<version>${version.org.apache.activemq}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<version>${version.org.apache.activemq}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-journal</artifactId>
<version>${version.org.apache.activemq}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-native</artifactId>
<version>${version.org.apache.activemq}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-selector</artifactId>
<version>${version.org.apache.activemq}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-server</artifactId>
<version>${version.org.apache.activemq}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-service-extensions</artifactId>
<version>${version.org.apache.activemq}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-messaging-it-stream-common</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-cloud-starter</artifactId>
<scope>test</scope>
<artifactId>opentracing-spring-cloud-jms-starter</artifactId>
<version>${version.io.opentracing.contrib.opentracing-spring-cloud-jms-starter}</version>
</dependency>
<dependency>
<groupId>me.snowdrop</groupId>
<artifactId>spring-cloud-starter-stream-artemis</artifactId>
<version>${version.me.snowdrop.spring-cloud-starter-stream-artemis}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jms-server</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void testFlowFromSourceToSink() {
}

@Test
public void testFromFromJmsTemplateToSink() {
public void testFlowFromJmsTemplateToSink() {
jmsTemplate.setPubSubDomain(true);
jmsTemplate.convertAndSend("testDestination", "Ping");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
spring:
cloud:
stream:
artemis:
binder:
transport: org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory
bindings:
input:
destination: testDestination
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2017 The OpenTracing Authors
* Copyright 2017-2018 The OpenTracing Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -19,22 +19,21 @@
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.messaging.Message;

/**
* @author <a href="mailto:gytis@redhat.com">Gytis Trikleris</a>
*/
@EnableBinding(Sink.class)
public class Receiver {

private final List<Message> receivedMessages = new ArrayList<>();
private final List<String> receivedMessages = new ArrayList<>();

@StreamListener(Sink.INPUT)
public void receive(Message message) {
public void receive(String message) {
receivedMessages.add(message);
}

public List<Message> getReceivedMessages() {
public List<String> getReceivedMessages() {
return receivedMessages;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2017 The OpenTracing Authors
* Copyright 2017-2018 The OpenTracing Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -33,7 +33,7 @@ public Sender(Source source) {
this.source = source;
}

public void send(Object payload) {
public void send(String payload) {
Message message = MessageBuilder.withPayload(payload)
.build();
source.output()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public void testFlowFromSourceToSink() {
assertThat(outputSpan.tags()).containsEntry(Tags.COMPONENT.getKey(), OpenTracingChannelInterceptor.COMPONENT_NAME);
assertThat(outputSpan.tags()).containsEntry(Tags.MESSAGE_BUS_DESTINATION.getKey(), "output");

MockSpan inputSpan = getSpanByOperation("send:input");
assertThat(inputSpan.parentId()).isEqualTo(0);
MockSpan inputSpan = getSpanByOperation("receive:input");
assertThat(inputSpan.parentId()).isEqualTo(outputSpan.context().spanId());
assertThat(inputSpan.tags()).hasSize(3);
assertThat(inputSpan.tags()).containsEntry(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_PRODUCER);
assertThat(inputSpan.tags()).containsEntry(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_CONSUMER);
assertThat(inputSpan.tags()).containsEntry(Tags.COMPONENT.getKey(), OpenTracingChannelInterceptor.COMPONENT_NAME);
assertThat(inputSpan.tags()).containsEntry(Tags.MESSAGE_BUS_DESTINATION.getKey(), "input");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.integration.support.MutableMessageHeaders;
Expand Down Expand Up @@ -69,15 +70,16 @@ public void shouldGetMessageWithNewHeaders() {
@Test
public void shouldPreserveTimestampAndId() {
MutableMessageHeaders headers = new MutableMessageHeaders(new HashMap<>());
headers.put("id", "1");
String id = UUID.randomUUID().toString();
headers.put("id", id);
headers.put("timestamp", "123456789");
Message<String> message = MessageBuilder.createMessage("test", headers);

MessageTextMap<String> map = new MessageTextMap<>(message);
Message<String> copiedMessage = map.getMessage();

assertThat(copiedMessage.getHeaders()).contains(new AbstractMap.SimpleEntry<>("timestamp", "123456789"));
assertThat(copiedMessage.getHeaders()).contains(new AbstractMap.SimpleEntry<>("id", "1"));
assertThat(copiedMessage.getHeaders()).contains(new AbstractMap.SimpleEntry<>("id", id));
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@

<version.io.opentracing>0.31.0</version.io.opentracing>
<version.org.awaitility>3.0.0</version.org.awaitility>
<version.org.springframework.boot>1.5.8.RELEASE</version.org.springframework.boot>
<version.org.springframework.cloud>Dalston.SR4</version.org.springframework.cloud>
<version.org.springframework.boot>2.0.3.RELEASE</version.org.springframework.boot>
<version.org.springframework.cloud>Finchley.SR2</version.org.springframework.cloud>

<!-- plugins -->
<version.maven-deploy-plugin>2.8.2</version.maven-deploy-plugin>
Expand Down

0 comments on commit 2107748

Please sign in to comment.