Skip to main content

BES6.x - JMS SonicMQ DISCARDABLE Delivery Mode

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

  • Product Name: BES
  • Product Version: 6.x
  • Product Component: JMS integration
  • Platform/OS: All Platforms

With SonicMQ6 as JMS Vendor and deliver mode set as DISCARDABLE, application hit the following exception:

javax.jms.IllegalStateException: Invalid delivery mode DISCARDABLE

Resolution:

The DISCARDABLE delivery mode behavior should be the same in SonicMQ 6.x as it was in 4.x. Namely, it's only available for non-transacted topic sessions.

If the session you're working with is either transacted or queue-based then it's expected to hit IllegalStateException error.

Firstly make sure you are not using a transacted session in this case.

An alternative, perhaps preferable to using the DISCARDABLE delivery mode, would be to disable flow control. In this case, publish() call will throw an exception rather than block if the broker-side buffers are full when a message is published. This allows you to choose how to handle the situation (for example, waiting before retrying the publish). This creates some additional work on the developer's part, but provides more control. It also avoids the possibility of messages being silently discarded - something that's inherent with the DISCARDABLE delivery mode.

Flow control can be disabled via Session.setFlowControlDisabled() API.

Note that some new features have been introduced since SonicMQ 4.x which can help deal with slow subscriber situations. "Flow To Disk" means it's possible to have messages off loaded to disk if they build up temporarily due to a short-term slow subscriber. "Shared Subscriptions" allows a number of shared subscribers to share the load on a given subscription. This can help solve problems caused by long term slow subscribers.

Old KB# 15382

#VisiBroker
#JMS
#BorlandApplicationSerrver
#Security