• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JMS problem

 
author
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
We have a j2ee application where a JMS queue notifies clients (consumers) about their elaboration process.

In other words when the client is connected it should receive messages like "Elaboration started", "Elaboration completed" and so on.

Since there are many clients, I have added to the message a clientId property so that inside onMessage the message is acknowledged only if it "belongs" to the client. (CLIENT_ACKNOWLEDGE).

Here comes the problem.

Suppose "Elaboration started - client 1" message goes to client 2 (which refuses the message) and meanwhile "Elaboration completed - client 1" goes to client 1 (whick acks the message and close connection)
then client 1 will never receive the first message because the connection is closed !

I hope my explanation is clear.

How would you correct this architecture ? I'm thinking to add a sequence number to the message so that they are ack'ed in the right order......maybe there are some feature of jms I miss which could be better.....like jms temporary queues ?

any idea ?
Thanks
Francesco
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Suppose "Elaboration started - client 1" message goes to client 2 (which refuses the message) and meanwhile "Elaboration completed - client 1" goes to client 1 (whick acks the message and close connection)



You are sharing the Connection object among the consumers of the "Elaboration.." message. Acknowledging the message does not mean that the connection is closed. The connection must be closed explicitly.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic