Author |
Message
|
satya2481 |
Posted: Mon Jan 05, 2015 8:55 am Post subject: Trigger Flow at specified interval based on cron expression |
|
|
Disciple
Joined: 26 Apr 2007 Posts: 170 Location: Bengaluru
|
Hi All,
Need to implement below requirement using WMB V7. Can some one help to understand how the cron expression can be setup to start a flow. I have searched the forum and didnt get any information which I can use it.
1. Receive request from queue
2. Send request to External Application A
3. Receive response from External App A
4. Response from App A contains where to route the message and at what time it has to be sent in a field with cron expression
5. Message flow has to store all the transactions in a database
6. Once the Trigger time reaches flow has to bulk all the transactions and send it to Application B
Issue here is Application A sends the response with a cron expression based on that flow has to trigger at that interval automatically and bulk the messages.
Is there any support pac or built in node available which can be used as a cron expression evaluator and scheduling?
Regards
Satya |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jan 05, 2015 9:02 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You haven't said what kind of transport to use to send the request or receive the response.
You can use Collector node instead of a database and cron to store transactions until a specific time interval has expired. |
|
Back to top |
|
 |
satya2481 |
Posted: Mon Jan 05, 2015 4:25 pm Post subject: |
|
|
Disciple
Joined: 26 Apr 2007 Posts: 170 Location: Bengaluru
|
Quote: |
You haven't said what kind of transport to use to send the request or receive the response.
|
Application A communication protocol is HTTPS
Application B communication protocol is WMQ |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 06, 2015 5:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Yes, so you can use Broker nodes to send both of those types of requests. |
|
Back to top |
|
 |
satya2481 |
Posted: Fri Jan 09, 2015 4:35 pm Post subject: |
|
|
Disciple
Joined: 26 Apr 2007 Posts: 170 Location: Bengaluru
|
Quote: |
Yes, so you can use Broker nodes to send both of those types of requests. |
I was not looking for this information. As per my first post, information is required on how to achieve the.
To update on this thread, the issue is resolved as the Application which sends the cron expression agreed to send the next Batch time window. Otherwise the option is to make use of Java function and invoke from the flow. |
|
Back to top |
|
 |
zpat |
Posted: Sat Jan 10, 2015 1:24 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Make the message flow start on message arrival. Edit a script to send a message. Run that script under cron.
Something like support pac MA01 can create a message without coding. However you can just create a file in directory being watched by a file input node.
This presuimes you can use the actual cron to do the scheduling. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Jan 10, 2015 9:05 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
The poster has not mentioned what platform they are using/proposing to use.
cron is the key for Unix/Linux environments.
As for Windows, there are a number of products out there that work very well.
We tried the windows scheduler but it is IMHO a POS.
We settled for z-cron. Works a treat.
There are other alternatives that are worth considering. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jan 12, 2015 5:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
satya2481 wrote: |
Quote: |
Yes, so you can use Broker nodes to send both of those types of requests. |
I was not looking for this information. As per my first post, information is required on how to achieve the. |
Yes. You can achieve this by using the correct broker nodes wired into a message flow in the correct manner.
Did you need to know which specific nodes? Did you need to know how to build a message flow? Did you need to know how to design general programming logic? Did you need to know how to implement general programming logic in a message flow?
Did you have specific questions about specific broker nodes that can control timing of events, and can be configured based on the contents of a message?
Cron and other external schedulers are great. It should be reasonably possible to parse a 'cron expression' into an interval past the current time and use that with native broker capabilities. |
|
Back to top |
|
 |
satya2481 |
Posted: Mon Jan 12, 2015 3:38 pm Post subject: |
|
|
Disciple
Joined: 26 Apr 2007 Posts: 170 Location: Bengaluru
|
Thank you all for your responses.
I am aware of usage of Timer nodes. My question was around how to make use of cron expression returned back from the Application A, as I have mentioned starting of this thread.
Quote: |
4. Response from App A contains where to route the message and at what time it has to be sent in a field with cron expression |
Further update on this is that Application A agreed to send the response with the actual date time on when the next Batch has to be sent. So the logic we are building is to store this time as a END_BATCH_TIME in a table and every 1-2 mins poll this table to find out which all batches are due to be processed, by comparing to Current timestamp.
Any better logic? Any disadvantages/issues with this logic? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 12, 2015 7:22 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Poor design. Send a message with all the batch information into an END_OF_BATCH queue and immediate action can be taken...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 13, 2015 6:18 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So you're asking how to parse a cron expression into something you can pass to a TimeoutControl node. That was clearer in your original question, sorry I didn't focus on it.
You can probably build a quick DFDL model to do that, or just use a lot of substring and CASTS to do it without a model.
You might look, instead of using timers, at using the DatabaseInput node. The sending application, or a flow, can create a record in an Event table that indicates the batch number of something that is ready to be sent. This will trigger the DatabaseInput node, and you can then run a SELECT to fetch the batch and build an output message.
Or, as fjb_saper suggests, the sending application can build the batch itself as it's ready to be sent, and give it to you for processing. Kind of depends on how big the batch is, and how it needs to be sent out.
More interestingly, you might figure out if there's a way you can avoid using a batch at all, and process each record as it happens. |
|
Back to top |
|
 |
|