I am new user to Java ranch. First of i want to thank all of the great people who provide solutions for people in need. Thanks for all the good deeds.
Here is my problem that i am stuck with.
I am java developer and my lead gave me this problem and asked me to come up with a solution and implement that.
The problem is: We are interfacing with another group and we exchange messages using webservices. Suppose the other group name is xxx. When xxx sends messages using webservices, we use JMS queue on our side and wrote MDBs to consume the messages. Now what my lead wants me to do is, when our system sends messages to xxx, we need to implement a message queue so that message passing is asynchronous. He wan't everything done on my side and not on xxx side. I was thinking, that i can implement a queue and the messages from webservices will be stored in a queue and if the xxx group writes a MDB, they can access the queue. But my lead says, they don't have to do anything. we have to do everything on our side and they should be able to consume messages as they used to do with webservices. he wants to find out a solution for this and implement that. Can anybody please let me know if they have any solution for this. Actually i am new to JMS, but i think i can implement that if i just know the solution. One of my friends said, untill xxx group has some kind of JMS listener, they can't consume the messages and so this is not possible. Can anybody help me get a solution for this
PS: i forgot to tell that we are using JBoss as our server.
Your requirement is not clear to me. What is the other application (xxx in your example) going to do if you are sending the message to the queue and your application is listening to the same messages?
If the other application has to consume a message from your queue then they need to listen to your queue. If the other application exposes a webservice which you can call then you can call it directly from your app.
Thanks for taking time and answering my question. Yes you are correct. Without the xxx application not having any kind of JMS listeners it's not possible for them to consume messages from the queue. Thats what i told my lead. But he says, without the xxx application having to do a single thing, they should be able to consume messages. So we have to find a solution on our end. Here it is what is happening now. We have a webservice exposed to them and they call it directly right now. But my lead is worried about scenarios like if that application's server is down for some reason then our messages might be lost. So he says we need to place msgs in a queue and send them to them until, we are sure they got the messages. So my lead asked me to find a solution for this. Means how to accomplish this and also implement that.
So again my question is, is there any way that we can perform asynchronous messaging without the xxx application having to do nothing and only we do everything on our side. Is it even possible? If so How?
Thanks a lot in advance Amit and everybody else who is looking at this post and trying to help me.
What you can do here is, have a durable Queue say "A" with infinite redelivery, post all your messages to the queue "A", listen to the queue "A" via an MDB etc, in your MDB call the webservice of the xxx application. If the xxx application is down rollback the transaction so that the message is sent back to the Queue.
I am not sure if the above is a correct approach. As the same message will again be send to the MDB and it will fail continuosly unless the xxx app is up and running.