Sending a message in full JMS queue

I am writing Java code that sends messages to a JMS queue. I do this using "QueueSender.send ()".

JMS queues are sonicMQ, but this is near the point.

My problem is that sometimes the JMS queue is full and the thread that is trying to send messages to the queue is starving.

Is there a way to find out if the queue is full before sending a message? In this case, I would prefer to print the exception in the log.

By the way, the JMS queue code itself is out of reach. I can only change the client code.

Thank.

+3
source share
3 answers

asynchronic, setAsynchronousDeliveryMode Constants.ASYNC_DELIVERY_MODE_ENABLED ConnectionFactory

spring

<bean id="connectionFactory" class="progress.message.jclient.QueueConnectionFactory">
...
 <property name="asynchronousDeliveryMode">
  <util:constant static-field=  "progress.message.jclient.Constants.ASYNC_DELIVERY_MODE_ENABLED"/>
</property>
</bean>

. progress.message.jclient Class ConnectionFactory

+2

JMS sonicMQ, .

, QueueMaxSize SonicMQ, .

, JMS , , , .

Sonic MQ 7.5 QueueMaxSize , ( ) :

, , QueueMaxSize. , , .

, , JMX, , ( SonicMQ V7.5, ). , . , , , .

+2

, , SonicMQ, Flow Control. , , . , .

, , , API Managemnt JMX-. :

  • FlowControl SonicMQ , .

However: this is only possible with the proprietary SonicMQ API, you cannot do this with standard JMS. I would ask SonicMQ environment administrators to monitor color management events and respond accordingly ...

+1
source

Source: https://habr.com/ru/post/1730655/


All Articles