Hi and thanks for your interest !
Marek, I checked my code and I had already set the mandatory and immediate flags to false.
Matthias, here is the description of my case :
the server (2.1.0) is started on linux after a clean.
I start 5 publishers that sends 2000 messages of 78 bytes per second on 10 exchnages. that is to say :
-10 exchanges (with x-lvc plugin that stores in mnesia database the last value for each message)
-10000 different messages @ 1Hz (= 10000 different routeId) --> ~700Kb/s
- each exchange handles 1000 msg/s
"top" shows me a 130% CPU load with no subscriber (= no queue) for the moment, just publishing.
Here are the control traces :
<i>Listing exchanges ...
amq.direct        direct
amq.topic        topic
tm://SAT.DRV7        x-lvc
tm://SAT.DRV1        x-lvc
amq.rabbitmq.log        topic
tm://SAT.DRV6        x-lvc
tm://SAT.DRV2        x-lvc
tm://SAT.DRV4        x-lvc
amq.fanout        fanout
tm://SAT.DRV8        x-lvc
tm://SAT.DRV3        x-lvc
tm://SAT.DRV5        x-lvc
tm://SAT.DRV0        x-lvc
amq.headers        headers
tm://SAT.DRV9        x-lvc
        direct
amq.match        headers
...done.
Listing queues ...
...done.
Listing channels ...
<rabbit@bigtune.269.0>        guest        false        0        0
<rabbit@bigtune.282.0>        guest        false        0        0
<rabbit@bigtune.293.0>        guest        false        0        0
<rabbit@bigtune.305.0>        guest        false        0        0
<rabbit@bigtune.321.0>        guest        false        0        0
...done.
Listing connections ...
guest        140.94.126.54        2831        running
guest        140.94.126.54        2834        running
guest        140.94.126.54        2835        running
guest        140.94.126.54        2833        running
guest        140.94.126.54        2832        running
...done.
Listing bindings ...
...done.</i>
I made the same test with direct exchanges (without mnesia) :
CPU load : 120%
Control traces :
<i>Listing exchanges ...
amq.direct        direct
amq.topic        topic
tm://SAT.DRV7        direct
tm://SAT.DRV1        direct
amq.rabbitmq.log        topic
tm://SAT.DRV6        direct
tm://SAT.DRV2        direct
tm://SAT.DRV4        direct
amq.fanout        fanout
tm://SAT.DRV8        direct
tm://SAT.DRV3        direct
tm://SAT.DRV5        direct
tm://SAT.DRV0        direct
amq.headers        headers
tm://SAT.DRV9        direct
        direct
amq.match        headers
...done.
Listing queues ...
...done.
Listing channels ...
<rabbit@bigtune.373.0>        guest        false        0        0
<rabbit@bigtune.424.0>        guest        false        0        0
<rabbit@bigtune.438.0>        guest        false        0        0
<rabbit@bigtune.452.0>        guest        false        0        0
<rabbit@bigtune.468.0>        guest        false        0        0
...done.
Listing connections ...
guest        140.94.126.54        2956        running
guest        140.94.126.54        2955        running
guest        140.94.126.54        2952        running
guest        140.94.126.54        2954        running
guest        140.94.126.54        2953        running
...done.
Listing bindings ...
...done.</i>
What disturbs me is this high CPU load whereas there is no subscriber. That's the reason why I search a way to "control the message flow sent by publishers". for instance when listening the bindings on a subscriber.
Thanks a lot for your help.
Romain
<blockquote class="quote light-black dark-border-color"><div class="quote light-border-color">
<div class="quote-author" style="font-weight: bold;">Marek Majkowski wrote:</div>
<div class="quote-message">
> I try to find some ways to enhance this. So my question : would it be
> possible to publish essages to the exchange only if there is at least one
> consumer that subscribed this message ? In other words, I would like to
> implement a kind of binding listener on exchanges and a way to request the
> list of bindings (in Java).
>
> I searched the api and it doesn't seem to be available. I am also aware that
> this breaks the publisher/subscriber model since the publisher doesn't have
> to carry about diffusion, it just publishes.
Have you looked at the "immediate" and "mandatory" flags in basic.publish?
>From http://www.rabbitmq.com/api-guide.html:
"If a message is published with the "mandatory" or "immediate" flags
set, but cannot be delivered, the broker will return it to the sending
client (via a AMQP.Basic.Return command)."
Cheers,
Marek
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
</div>
</div></blockquote>
<br><hr align="left" width="300">
View this message in context: <a href="http://old.nabble.com/Publish-messages-only-when-needed---tp29904396p29913525.html">Re: Publish messages only when needed ?</a><br>
Sent from the <a href="http://old.nabble.com/RabbitMQ-f25704.html">RabbitMQ mailing list archive</a> at Nabble.com.<br>