These are chat archives for spring-cloud/spring-cloud

21st
Nov 2016
Johan van den Berg
@johanvdb
Nov 21 2016 02:54

We are using hazelcast for both cache and leadership election in spring cloud.


spring:
  hazelcast:
    config: classpath:lithium/common/hazelcast-cluster.xml
  cache:
    hazelcast:
      config: classpath:lithium/common/hazelcast-cluster.xml
  cloud:
    cluster:
      hazelcast:
        config-location: classpath:lithium/common/hazelcast-cluster.xml

Unfortunately this configuration seems to start two hazelcast instances. Anyone have any idea how to make the two subsystems only start one hazelcast?

Stefan Pfeiffer
@dl1ely
Nov 21 2016 11:38
In Spring Cloud Stream, i use the AMQP binder, and my exchange gets created with the name given in spring.cloud.stream.bindings.input.destination (Using Sink.class as Binding), but that creates the exchange as a topic exchange. I need a fanout exchange. How can i achieve that?
Dave Syer
@dsyer
Nov 21 2016 11:43
You can't, as far as I know (it would change the semantics). Why do you want to do that?
Stefan Pfeiffer
@dl1ely
Nov 21 2016 11:49
I have a legacy app that publishes Events to a fanout exchange. I want my spring cloud stream enabled services to react on them. I connect them to the said exchange. When the legacy app gets started first, the exchange gets created by the producer as fanout exchange. My services connect there happily and receive the events. But when one of my services starts up before the legacy app, the service creates the exchange as a topic exchange, and later when the legacy app comes up, it aborts with an exception because the exchange is already there but with the wrong exchange type. I would like to make the behaviour independant of what part of the system comes up first.
Exception in the legacy app is: Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'eauthor.events' in vhost '/': received 'fanout' but current is 'topic', class-id=40, method-id=10)
The other way around, the spring cloud stream enabled apps do not care what type the exchange is if it is already there.
But well, if there is no way to enforce a fanout exchange, i can live with the topic exchange, too. Given a routing key #, they are equivalent for my purpose.
Stefan Pfeiffer
@dl1ely
Nov 21 2016 11:54
But then i need to change the legacy app to also expect a topic exchange. Doable, but nasty.
Do Spring Cloud Stream Sinks always set the routing key # on their configured exchange for their private queue?
Dave Syer
@dsyer
Nov 21 2016 11:59
The semantics are controlled by consumer groups.
Stefan Pfeiffer
@dl1ely
Nov 21 2016 11:59
Ah, right, thanks for the pointer
Dave Syer
@dsyer
Nov 21 2016 11:59
So the amqp specific parts of that depend on whether or not there is a consumer group
By default I think there is not. And the semantics are pub-sub to all consumers.
Stefan Pfeiffer
@dl1ely
Nov 21 2016 12:00
The link between generic Stream concepts and their mapping to AMQP concepts was not quite clear to me on that one
Dave Syer
@dsyer
Nov 21 2016 12:00
Raise a ticket for more docs?
Stefan Pfeiffer
@dl1ely
Nov 21 2016 12:03
Will do (not raising the ticket but providing the PR)
Eugenio Romano
@eromano
Nov 21 2016 12:54
Hi guys someone knows which is the best way to apply a custom ZuulFilter to only some specific routes?
Dave Syer
@dsyer
Nov 21 2016 12:56
Check the path in the shouldFilter()?
Eugenio Romano
@eromano
Nov 21 2016 13:01
ok thanks @dsyer
周立
@eacdy
Nov 21 2016 16:04
spring-cloud/spring-cloud-netflix#1487 Is there anyone help me?