|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Design Suggestion |
« View previous topic :: View next topic » |
Author |
Message
|
kristymq |
Posted: Mon Jun 23, 2008 3:36 am Post subject: Design Suggestion |
|
|
Newbie
Joined: 23 Jun 2008 Posts: 3
|
Hello, I've the requirement to read the file from FTP server & process it within a message flow. The entire request message should get processed (including the file reading time) in 3 secs or the request should get terminated. Here I can use timer nodes to control the message process in 3 secs within message broker. But how do I calculate the "file reading" time from external FTP location inside message broker? I understand I cannot use MQInput / File nodes in the middle of the message flow after timer node.
Any of your suggestion is highly appreciated. |
|
Back to top |
|
 |
mqmatt |
Posted: Mon Jun 23, 2008 6:05 am Post subject: Re: Design Suggestion |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
kristymq wrote: |
I can use timer nodes to control the message process in 3 secs within message broker |
If by "control the message process" you mean "stop the message flow", then I wouldn't recommend it. Timer nodes won't work - inflight units of work will be completed before the flow stops, and your response times to the stop messages will not be processed quickly enough.
Your best bet is to use Compute or JavaCompute nodes at the start of the flow to record the time, then again to check the current time is less than 3s just before you propagate to the final output terminal.
Store this state information in the local environment, to allow multiple instances to work concurrently.
Edit: Except of course, you're using FileInput nodes which will occur at the beginning of your flow; so you won't have the opportunity to set the "start of processing" time. You may need to instead look at the modification date of the file on the FTP server to see when it arrived. I'm not sure how you could do this, or how reliable the information would be. |
|
Back to top |
|
 |
mqpaul |
Posted: Tue Jun 24, 2008 5:20 am Post subject: Re: Design Suggestion |
|
|
 Acolyte
Joined: 14 Jan 2008 Posts: 66 Location: Hursley, UK
|
mqmatt wrote: |
Except of course, you're using FileInput nodes which will occur at the beginning of your flow; so you won't have the opportunity to set the "start of processing" time. |
It wasn't intended for this purpose, but you might use the LocalEnvironment.File.Timestamp field. The FileInput node creates it just before each record is located and propagated.
If your file contains multiple records, you might need to store this timestamp value somewhere persistent when the LocalEnvironment.File.Record is 1. Be aware that the Timestamp is a CHARACTER value in a pretty format; it's not a broker TIMESTAMP value; you need to convert it before any comparisons.
I prefer mqmatt's suggestion of using the LocalEnvironment.File.LastModified value; it is a TIMESTAMP value, and it's the same for all records in a file.
You will need to decrease the FileInput node polling interval property; the default is 3 seconds, so you're unlikely to meet your target . Note that you can't go below 1 second. I don't know the performance impact of polling so frequently.
As a general observation, it's more usual to handle timeouts at the client end - i.e. whoever sends the request usually ignores any responses that arrive too late. However, if the purpose of this 3 second timeout is to save the broker doing unnecessary work, that approach is clearly not appropriate. _________________ Paul |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 24, 2008 7:09 am Post subject: Re: Design Suggestion |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kristymq wrote: |
Hello, I've the requirement to read the file from FTP server & process it within a message flow. The entire request message should get processed (including the file reading time) in 3 secs or the request should get terminated. Here I can use timer nodes to control the message process in 3 secs within message broker. But how do I calculate the "file reading" time from external FTP location inside message broker? I understand I cannot use MQInput / File nodes in the middle of the message flow after timer node.
Any of your suggestion is highly appreciated. |
I would go as far out as to advise you to scrap the FTP entirely. Put the messages to MQ and set the expiry time on the message.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|