I'm afraid that I can't think on any really elegant solutions.
Re "I need some kind of notifications from JMS Client API that I am able
to send".
I don't think that the JMS API has a mechanism for doing this, though I
may be wrong.
The best approach that I can think of at the moment is to intercept the
queueThresholdExceeded Event, this would allow your producer client to
detect that the queue is about to fill up and stop producing.
You could then periodically poll the queue size as described previously
to decide when to start sending again.
It might be nice if QMF2 could be updated to have a "low water mark"
event similar to the threshold exceeded upper water mark event as that
would make polling in your scenario unnecessary. I don't think such a
thing exists yet - does anyone have any thoughts on whether that'd be
generally useful?
As an alternative approach you could look into flow control. I've not
tried this myself and obviously it'll depend on your overall Enterprise
scenario whether it's an appropriate approach, but it might be worth
looking at.
Sorry I can't be more help
Frase
dmounessa wrote:
Thanks -- I need the queue size because I am not sure how to find out when i
can send messages to a durable queue after i get JMS Exception that the
queue is max-ed out.
I was testing and I send 10000 message and I changed the jfile to 4 so I get
Queue Filled Exception.
Then I started a receiver to read the Messages from the queue. After the
receiver has finished reading the sender should be able to start sending
more messages --- But my test sender does not know when to do this. I need
some kind of notifications from JMS Client API that I am able to send. B/C
when I tried to send after the Queue is filled -- I get JMS Exception and i
can not send any more until I restart the app.
So I was thinking to prevent to get in to this situation - but this is not
the best solution.
Is there a way that I could get notification that Connection for queue is
good to be sent and do you have sample code for this?
Thanks
--
View this message in context:
http://apache-qpid-users.2158936.n2.nabble.com/Jave-Client-with-C-Broker-Messages-in-Queue-size-tp7055301p7068113.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]