Is JMS a good choice for nodes in cluster to report status to main node?
Hi all,
I am intending to use the jms to distribute the sub portion of the tasks to the available nodes in the cluster to speed up the time require to complete the actual task.
After the nodes finished the given sub portion of the task, it will report the status to the master node via the jms as well. however i am not sure will such an approach a good choice for doing the status reporting to the master node since we can't guarantee the queue (i will be using queue) is up and running. If the queue is not, then the status will be lost and the master node will not aware it and wait for the status from the nodes forever.
How can we ensure that the status will be delivered successfully to the main nodes? Or is there any alternative to achieve it ?
Many Thanks
[797 byte] By [
nie_fenga] at [2007-11-27 6:26:27]

# 1
Hi
JSM is good choice for yourApp. It supports 2 different message delivery models. One of them is Point-to-Point.
In this model, a message is delivered from a producer to one consumer. The messages are delivered to the destination, which is a queue, and then delivered to one of the consumers registered for the queue.
While any number of producers CAN send messages to the queue, each message is guaranteed to be delivered, AND consumed by ONE consumer.
If NO consumers are registered to consume the messages, the queue holds them until a consumer registers to consume them.
Context ctx = new InitialContext();
ConnectionFactory cf1 = (ConnectionFactory) ctx.lookup("jms/QueueConnectionFactory");
# 2
Hi,
Well, I am doing such a thing in slightly different way. According to the definition, queue is quite safe and you can guarantee semantic delivery. I think that you need a one and only once delivery semantic, because you don't want duplication in executing the sub portions, thus using a queue and persistent storage, you can guarantee such a semantic.
I think you need to log the computed portions to the persistent storage in order to support such an assumption.
If you give me more detail, I might be more helpful.
Cheers and good luck,
APTa at 2007-7-12 17:47:17 >

# 3
Hi Asghar, APT Thanks for ur reply,
My concern here is the reporting of status from the node to the master node, what happen if the queue has problem and the node can't perform the jndi lookup on the queue and thus the status failed to be delivered to master node.
What i am doing now is i have a scheduler (it will be started on the main node only) to monitor the task that has been distributed. The tasks that is distributed(a properties file) has been saved into a shared folder. So whenever the node has completed their given job, they will update the status to the task properties. The scheduler will let the master node know about the status of all the nodes.
Will it be a safer way to do that ?
Hi APT, u have mentioned about the logging of the computed portions to the persistent storage, could u elaborate more ? Do you mean the persistent of the jms msg is not guaranteed if I have delivered the jms to the queue without error? How you handle the case if the queue for reporting status has been failed to be lookup due to system error?
I have a similiar problem on the node as well. The actual task actually is handled by two component which deployed in the node. The node will inform the two components via the jms queue ( it will be delivered once only to the two components) as well after the node receive the instruction from the master nodes.
So after the two component have finsihed their job, they will update the node, the node will again update to the master node. My problem here is the status from the two component also can't be guarantee to be delivered to the node as well if the queu failed to be lookup.
For summarize my current design
................................................................................(JMS Q for both distribute task
..................................................................................and status report from
..................................................................................component)
...............................(JMS distribute via Q)........./........................Component1
............................/...........................................N1
.........................../..................................................\.........................Component2
Master node --.....(monitor nodes status
.............................\using scheduler)
.............................. \ .......................................Nn (same as N1)
Thanks :)