Merge branch '2.2.x'

This commit is contained in:
spencergibb
2020-07-06 17:57:50 -04:00
5 changed files with 11 additions and 4 deletions

View File

@@ -58,6 +58,7 @@
|spring.cloud.consul.discovery.server-list-query-tags | | Map of serviceId's -> tag to query for in server list. This allows filtering services by a single tag.
|spring.cloud.consul.discovery.service-name | | Service name.
|spring.cloud.consul.discovery.tags | | Tags to use when registering service.
|spring.cloud.consul.discovery.tags-as-metadata | true | Use tags as metadata, defaults to true.
|spring.cloud.consul.enabled | true | Is spring cloud consul enabled.
|spring.cloud.consul.host | localhost | Consul agent hostname. Defaults to 'localhost'.
|spring.cloud.consul.port | 8500 | Consul agent port. Defaults to '8500'.

View File

@@ -16,6 +16,8 @@
package org.springframework.cloud.consul.binder;
import java.util.Arrays;
import com.ecwid.consul.v1.ConsulClient;
import com.ecwid.consul.v1.QueryParams;
import com.ecwid.consul.v1.Response;
@@ -48,12 +50,15 @@ public class ConsulSendingHandler extends AbstractMessageHandler {
}
Object payload = message.getPayload();
if (payload instanceof byte[]) {
payload = Arrays.toString((byte[]) payload);
}
// TODO: support headers
// TODO: support consul event filters: NodeFilter, ServiceFilter, TagFilter
Response<Event> event = this.consul.eventFire(this.eventName, (String) payload,
new EventParams(), QueryParams.DEFAULT);
// TODO: return event?
// return null;
}
}

View File

@@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit;
import com.ecwid.consul.v1.ConsulClient;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -78,14 +77,12 @@ public class ConsulBinderApplicationTests {
}
@Test
@Ignore // FIXME: 2.0.0 need stream fix
public void shouldInitializeConsulSource() {
assertThat(this.events).isNotNull();
}
@Test
@Ignore // FIXME: 2.0.0 need stream fix
public void shouldPublishTextConsulMessage() {
// given

View File

@@ -18,6 +18,7 @@ package org.springframework.cloud.consul.serviceregistry;
import com.ecwid.consul.ConsulException;
import com.ecwid.consul.v1.ConsulClient;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -43,6 +44,7 @@ public class ConsulAutoServiceRegistrationFailFastTests {
@Rule
public ExpectedException exception = ExpectedException.none();
@Ignore
@Test
public void testFailFastEnabled() {
this.exception.expectCause(isA(ConsulException.class));

View File

@@ -19,6 +19,7 @@ package org.springframework.cloud.consul.serviceregistry;
import com.ecwid.consul.ConsulException;
import com.ecwid.consul.v1.ConsulClient;
import org.hamcrest.Matchers;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -49,6 +50,7 @@ public class ConsulAutoServiceRegistrationRetryTests {
@Rule
public OutputCaptureRule output = new OutputCaptureRule();
@Ignore
@Test
public void testRetry() {
this.exception.expectCause(isA(ConsulException.class));