Originally posted by: SystemAdmin
How you design the solution depends a lot on the wholistic business, audit, security, recovery and technical requirements balanced against cost, time, etc.
For example, if you have a requirement to:
-
ensure you never miss a message,
-
never process a message more than once and
-
provide an audit trail of what was received/processed when and what the result was
You might want to have one event that simply reads X messages at a time per thread, transforms and writes the output files to a work directory with a generated unique file name (possibly leveraging the MsgID or CorrelID from the message and date/time to ms + index) then have an output card that has a list of the files and their ID's. The scope of committing this output file or table is synch'd with the scope of deleting the input messages. This list of committed files is then read and moves the files from the work directory to a committed one. If using a table you could assign a "batch number" to the group of messages processed for further audit ability. If you need further fail over protection you might actually put the detail message into a blob in the database and then update the status on the row with each step.
Another technique would be to create a single output tree that could contain the output related to multiple messages and artificially create an initiator and terminator for the group. You would then commit this file and the removal of all messages that created it at the same time. A second process could have a special tree that would be used to split this file into the individual files in a work directory and a subsequent step to move them into a ready directory.
If you further had to ensure you processed the messages in order you might want to have only a single thread running. If this caused an issue with response time for individual messages as measured from when they arrived on the queue, you would look for ways to group them such as splitting the one queue into multiple queues based on something in the message header while treating the message body as a blob, etc.
If your requirements are fairly straightforward... don't care about the order or audit, just want to convert each message into a file --- leaving the MQ settings at single is the simplest. If this meets your throughput requirements then there is no need to go further. If it doesn't, create a map that will read multiple messages and create the files using run or put (could do both in a test) in one output card and have a subsequent element rule in the same output card issue an explicit FAIL. Do the same with it being a subsequent output card that issues the FAIL. Do this with various input and output on success / on failure settings and record the results. What you want to end up with is the message left on the queue if the file is not created and removed from the queue if it is. Now you can play with the message QTY and LSN parameters and the number of threads and compare the throughput you get to the single message process.
#DataExchange#IBMSterlingTransformationExtender#IBM-Websphere-Transformation-Extender