Posted: Wed Mar 12, 2003 7:00 am Post subject: Validate the following logic for Triggering
Apprentice
Joined: 17 Jun 2002 Posts: 25
I have to write an application which will get triggered when the depth of Queue changes from 0 to 1 (Trigger Type: FIRST). I came up with the following logic. Pls let me know if I am missing anything.
1. The application gets triggered
2. BROWSE for all the available messages
3. For each browsed message
3.1 Create MessageBean
3.2 PARSE the message
3.3 Create the domain Object
3.4 Create the corresponding XML
3.5 POST to the Vendor
3.6 Receive acknowledgement
4. If the step 3 results in any error condition then the message should be written back to the Mainframe and should be logged (message and the message ID and the application ID)
5. If step 3 doesnt result in any error condition then, the message is taken off from the queue (GET with wait interval)
6. After the steps (from 3 to 5) have been completed for all the browsed messages, SLEEP for a minute
6.1 BROWSE the queue for any new messages
6.2 If new messages found then perform steps 1 to 5 for all the new messages
6.3 If no new messages then ClOSE the Queues and Queue manager
It looks like you are implementing your own transaction logic.
It is easier, and better for your performance to GET each message from the queue inside a SYNCPOINT, and then either Commit the message, or Backout if an error occurs in your step 3.
Additionally, then you can decide if you want to put the message to another error or backout queue if you've tried to process it too many times with an error.
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