Question 1: JMS specifications do not guarantee delivery of Non-Persistent messages. As FioranoMQ server is 100% compliant with the JMS specifications, can it also drop NP messages in certain circumstances? In case it can, can you please describe when it drops the NP messages? Also let us know how can the configurable parameters be tweaked so that dropping of NP messages can be reduced significantly?
Yes, FioranoMQ server is 100% compliant with the JMS specs. It can drop NP messages on topics in one possible scenario. Although very rare, this scenario may surface in some of the business applications.
FioranoMQ server may drop NP messages only in one of the publish-subscribe model. However, it never drops them in point to point messaging model. Let us discuss the pubsub scenario in which it may drop the NP messages.
Consider that there are n subscribers (n>=1) listening for messages that are published on a topic. If all these subscribers are processing the messages at a rate which is comparable to the publish rate, then the NP messages never drops.
But if one or more subscribers are very slow, compared to the publish rate, then FioranoMQ server may drop the NP messages. Before actually dropping the NP messages, FioranoMQ server attempts to slow down the rate at which the messages are published (if configured). But even after this slows down, the publisher may keep on publishing the NP messages at a considerable rate (if slow down parameters are configured to values which do not slowdown the publisher much), then some NP messages may be dropped by the server.
An FioranoMQ administrator can modify the server configurations to minimize no of messages from being dropped, or can configure the topic so that the no of messages published on it are never dropped.
While creating a topic, the FioranoMQ Administrator can specify whether the messages can be dropped or not. He can use the following API in the topic metadata object to disable message dropping.
public void disableMessageDropping()
By default, topics are configured such that no messages can be dropped. Therefore, the administrator needs to explicitly and invoke the above API to disable the message dropping.
This disabling of message dropping, may lead to drop in, throughput the particular topic.
The above API is present only in FioranoMQ 7.5 onwards. In case you are using an earlier version of FioranoMQ, please try configuring the server so that it never drops the no messages.
An FioranoMQ administrator can configure the server in such a way, that the server never drops the NP messages in any practical scenario. Modifying the default configurations may lead to blocking of the publishers, which means that the publish rate may drop down, when the subscriber rate is very slow. However, the publisher publishs at its normal speed, as soon as the slow subscriber closes, or starts processing messages at a fast pace.
Before discussing the exact parameters that needs to be modified, let us discuss the internals of the server.
FioranoMQ server stores the non-persistent messages in its in-memory buffers. The non-persistent messages are dropped when no more messages can be added to the in-memory buffers i.e. when the in-memory buffers start overflowing. The administrator can configure the size of these in-memory buffers, as per their publish-sub-scribe rate, such that they never overflow. Administrators can also control the rate at which these buffers are filled by specifying the time interval for which publishers should wait before attempting to add a new message.
Configuring ExTopicSubscriberHandle.BasicAllowedSize parameter
This variable depicts the size of in-memory buffers of each subscriber instance. The default size of the subscriber buffer is 1024KB. Increase this value to 2048KB or 4096KB or even higher depending upon the message traffic using Fiorano Admin Studio in the offline mode. Perform the following steps to set the value of this parameter:
- Invoke the Fiorano Admin Studio.
- Select Tools > Configure FioranoMQ from the menu bar, select FioranoMQ folder in the resulting Select Profile Directory dialog box and click the Open button. This shifts the FioranoMQ environment to the offline mode.
- Now, navigate to FioranoMQ > Jms > PubSub > PubSubManager in the Server Explorer pane. The properties of the PubSubManager are displayed in the Properties pane.
- Select the ellipsis against the parameter BasicAllowedSize. Type in the new value in the resulting BasicAllowedSize dialog box and click at the OK button.
- Right-click the FioranoMQ domain in the Server Explorer and select the Save option from the resulting shortcut menu.
In case, if the subscribers listening on a topics are processing the messages fast enough that these buffers do not fill up to the brim. In such a case, the non-persistent messages never drops.