ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to check for duplicate XML files?

Post new topic  Reply to topic
 How to check for duplicate XML files? « View previous topic :: View next topic » 
Author Message
Bharat
PostPosted: Fri Jan 24, 2003 10:02 am    Post subject: How to check for duplicate XML files? Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

I'm using MQSI v2.0.1 for transforming and routing XML contracts. I'm getting an input XML file from one application. My requirement is: Sometimes that application may send duplicate XML contracts, when it encountered some database issues. I need to track that and ignore the duplicate XML files. The input XML file contains a tag called 'TransactionID'. I need to check for this tranactionID gets repeated to figure out duplicate XML files.

But right now I'm not tracking the transaction ID tag. As a MessageID is allotted to each message, MQSI is going by Message ID. I mean I'm storing this messageID in the DB2 database, but not the transactionID.

Which is the best way to track and discard the duplicate XML files in this case?

Thanks in advance,
Bharat
Back to top
View user's profile Send private message
kirani
PostPosted: Fri Jan 24, 2003 10:44 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Introduce a new field in the database to store TransactionId. In your message flow, first check for the Transaction ID, if it's duplicate continue with the processing for next tran id. For non-duplicate transaction ID do the transformation and insert a record into db for this transaction id.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Bharat
PostPosted: Fri Jan 24, 2003 11:25 am    Post subject: How to check for duplicate XML files? Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Kiran,

First let me thank you for your response.
Can I get the value stored in database in a Filter Node? For example there might be 100 rows of transaction IDs stored in that table? Do I need to check the transaction ID coming from the file with all these values?

Could you please send me the sample syntax of ESQL?

Thanks,
Bharat
Back to top
View user's profile Send private message
yaakovd
PostPosted: Fri Jan 24, 2003 11:51 am    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

I manage transaction IDs in DB2 for the similar problem. This table contains 200 000 records (is it enougth?).
The first node in flow is Filter, when I looking for ID:

EXISTS( SELECT * FROM Database.TRANS_TB AS T WHERE
T.TRANS_ID = "Root".<your input ID>)

or you ca use SELECT COUNT ... > 0

Also you can manage counter of duplications, date etc. if you need.
Good luck
_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
Bharat
PostPosted: Fri Jan 24, 2003 12:16 pm    Post subject: How to check for duplicate XML files? Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Yaakovd,

Thanks for your response.

EXISTS( SELECT * FROM Database.TRANS_TB AS T WHERE
T.TRANS_ID = "Root".<your input ID>)

Is it enough to check all the rows against the transaction ID existing in the XML file? I was thinking that we may need to write a SQL query with 'for loop'.

Before doing this comparision, I'm trying to store the Transaction ID in the database with the following syntax. But it is not getting stored.

INSERT INTO Database.Table(MESSAGEID, TRANSID) VALUES ( CAST(Root.MQMD.MsgId AS CHARACTER), Trim(Root.XML.request.control.transactionId) );

'transactionId' is in the control block of the XML file.

Could you please guide me with right syntax?

Thank you so much,
Bharat
Back to top
View user's profile Send private message
yaakovd
PostPosted: Fri Jan 24, 2003 12:30 pm    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

If you have more then 1 transaction ID in message - you need loop.

I suggest create subflow, which process eacn transaction by following logic:

1. Filter {EXISTS( SELECT * FROM Database.TRANS_TB AS T WHERE
T.TRANS_ID = "Root".<your input ID>) }

True: --> 2. Ignore the message or update counter of duplications ...

False: --> 3. Data Insert Node which insert your transaction ID into the table

3 --> 3A - process the message
_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
Bharat
PostPosted: Fri Jan 24, 2003 12:43 pm    Post subject: How to check for duplicate XML files? Reply with quote

Acolyte

Joined: 14 May 2002
Posts: 61
Location: Reston, VA, USA

Thank you so much Yaakovd.

I will try this and let you know if there are any problems.

Best Regards,
Bharat
Back to top
View user's profile Send private message
yaakovd
PostPosted: Fri Jan 24, 2003 12:49 pm    Post subject: Reply with quote

Partisan

Joined: 20 Jan 2003
Posts: 319
Location: Israel

Don't forget to add database connection in Filter and Data Insert nodes.
_________________
Best regards.
Yaakov
SWG, IBM Commerce, Israel
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to check for duplicate XML files?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.