Bluelock / camel-spring-amqp

Spring AMQP Component for Apache Camel
61 stars 53 forks source link

create exchange seems to be invoked every time a message is produced #66

Closed laureate-gmaurizio closed 9 years ago

laureate-gmaurizio commented 9 years ago

whenever we produce a new message, we get a log entry INFO Using default exchange of type TopicExchange indicating that the doStart process and attempt at creating the exchange seems to be invoked every time. This happens regardless of the exchange type.

drasil commented 9 years ago

Hi. I do not see the value of this log entry, but it does not say and mean that there is an attempt to declare the exchange in the broker. In fact the opposite is true - the exchange is declared when it is not the default exchange (see the SpringAMQPProducer.doStart() method). And by the way the default exchange is always of the "direct" type.

laureate-gmaurizio commented 9 years ago

the value is to illustrate that every message sent attempts to create the exchange. Regardless of whether is uses the default exchange or a named exchange of any type. The exchange should be created only once at the beginning, or at worst after a connection retry attempt, not in every message that is sent. Looking at the doStart method in the source code, I think this might happen because at the beginning the existence of the exchange is not checked.

drasil commented 9 years ago

Once again - no exchange is being declared in the broker when the endpoint uses the default exchange. The "this.endpoint.createAMQPExchange()" command on SpringAMQPProducer line 68 does not declare the exchange in the broker. Exchange declaration comes later on line 74 there ("this.endpoint.amqpAdministration.declareExchange(this.exchange)") and happens just when the endpoint is not using the default exchange (which makes sense because the default exchange always exists).

laureate-gmaurizio commented 9 years ago

ok, maybe I am not clear enough. Forget about the default exchange that is mudding the issue. Regardless of the exchange used, it seems like it gets declared EVERY time a message gets posted to the . Is this the supposed behavior?

drasil commented 9 years ago

OKay, than this probably duplicates issue #55, I filed a year ago. If you want this fixed, you can use my fork of this project. This project seems to be no longer actively maintained.

laureate-gmaurizio commented 9 years ago

great. thanks! do you have a pom.xml dependencies to point to, or is it just compile and deploy?

laureate-gmaurizio commented 9 years ago

Can you support transactions?

Gustavo Maurizio +1-443-253-9198 https://zoom.us/j/4432539198 https://zoom.us/my/gustavo.maurizio

From: Pavel Drasil Reply-To: Bluelock/camel-spring-amqp Date: Tuesday, August 25, 2015 at 12:21 PM To: Bluelock/camel-spring-amqp Cc: Gustavo Maurizio Subject: Re: [camel-spring-amqp] create exchange seems to be invoked every time a message is produced (#66)

OKay, than this probably duplicates issue #55https://github.com/Bluelock/camel-spring-amqp/issues/55, I filed a year ago. If you want this fixed, you can use my fork of this projecthttps://github.com/drasil/camel-spring-amqp. This project seems to be no longer actively maintained.

— Reply to this email directly or view it on GitHubhttps://github.com/Bluelock/camel-spring-amqp/issues/66#issuecomment-134657750.

laureate-gmaurizio commented 9 years ago

thanks Pavel. your branch solved the problem.

laureate-gmaurizio commented 9 years ago

Again thanks! pity this is not formally followed, since it is great code and deployment.