Search code examples
javajakarta-eejmswildfly-8

Sending instantaneous JMS messages, representing progress of processing


I'm using a JMS topic (with non-durable subscribers) to report the progress of server-side processing to the clients. The application server itself is WildFly 8.2, the client(s) is a JavaFX application.

At every specific milestone (let's say: every tenths of the work done) of the server-side processing a JMS message is sent to the topic, to which clients are subscribed. The idea is, when a JMS message is received, it can be used to drive a "progress bar" forward.

My problem is, that some kind of buffering (?) happens somewhere in the system, presumably on the server-side. The processing itself is a longer one, 10 to 30 seconds, and the messages are sent to queue -according to the logs- roughly evenly, one in 1-3 sec.

However, on the client side the whole bunch of messages are received within a very short time frame, typically under 0.5 sec, usually at the end of the whole processing.

How could I use JMS messaging to represent real-time progress?


Solution

  • As I've written in a comment, Nicholas was right. The transaction attribute had to be set to TransactionAttributeType.REQUIRES_NEW. This way the messaging bean can send the JMS message instantly, without waiting for the processing bean.