Link to home
Start Free TrialLog in
Avatar of Jay Roy
Jay RoyFlag for United States of America

asked on

Checking for duplicate jms Textmessages in a folder

Hi guys
I have a scenario where I have a folder c:\messages.
I am listening a queue for text messages (jms.Textmessage)
I have two requirments
To save the Textmessage in the messages folder. The Textmessage file name should be the messageid.( messageid is unique for each Textmessage).

If the Textmessage file already exists in the messages folder then it should not be saved.

Any idea how I can go about doing this? Any help with code is greatly appreciated.
Thanks.
Avatar of mccarl
mccarl
Flag of Australia image

Have you already got some code that we can start from?
Avatar of Jay Roy

ASKER

Yeah,


// my listener which is listening for Textmessages on the Queue.
Public class Mylistener{

Public void onMessage(Jaxax.jms.Message message){
if (message instanceOf Jaxax.jms.TextMessage){
String messageId = message.getJmsMessageId();

// here I want to check if a Textmessage file with filename as messageId already exists in the
// C:\messages folder. If it doesn't exist then add the Textmessage to the messages folder.
}
}
}

Thx.
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial