Author |
Message
|
MQ_user1 |
Posted: Tue Jul 08, 2014 7:30 am Post subject: Send files to MQ based upon Path mentioned in Request Messag |
|
|
Novice
Joined: 09 Jun 2010 Posts: 19
|
Hi Guys,
Probably...... This is my first post in this section.
I need your help in setting up below scenario.
Scenario: 1 Request Queue,1 Response Queue.
Files are organized in local disk with a hirerachy.
Basing upon "Path" mentioned in Input Message , Files which are in that Path/Directory needs to be picked up and sent to Response Queue mentioned in Input Message.
I guess, we need to use 1 MQInput Node,1 MQOutput Node and Compute Node for this scenario/flow.
But I'm missing actual logic in ESQL to code? Can some one shed some light on this. It may look silly to you but please help me.
Note: Files are located in another server and message floe runs in another server.
Thanks
ARaj |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 08, 2014 7:35 am Post subject: Re: Send files to MQ based upon Path mentioned in Request Me |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MQ_user1 wrote: |
I guess, we need to use 1 MQInput Node,1 MQOutput Node and Compute Node for this scenario/flow. |
If you're reading files, a FileRead node might help as well.
MQ_user1 wrote: |
But I'm missing actual logic in ESQL to code? Can some one shed some light on this. It may look silly to you but please help me. |
So taking this:
Quote: |
Basing upon "Path" mentioned in Input Message , Files which are in that Path/Directory needs to be picked up and sent to Response Queue mentioned in Input Message |
I'd say you need ESQL to extract the path and the response queue from the input message, along with ESQL to provide those to the FileRead and MQOutput nodes respectively.
Simple.
You might also want some ESQL to deal with the file not being present, the connectivity to the remote server being lost, the file you're trying to read being too large for the resources available to the flow, etc, etc.
Plus all the needed WMQ and ftp configuration (inside WMB and outside) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
MQ_user1 |
Posted: Tue Jul 08, 2014 7:44 am Post subject: |
|
|
Novice
Joined: 09 Jun 2010 Posts: 19
|
Hi Vitor,
Thanks for your quick reply.
One more question:
As FileInput node doesn't have Input terminal....Can I use it in Sub-flow?
Will that work?
Thanks
ARaj |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Jul 08, 2014 7:47 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
My esteemed collague stated that the 'FileRead' node might be needed.
This has an Input Terminal unlike the FileInput Node which as you discovered does not. _________________ 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 |
|
 |
MQ_user1 |
Posted: Tue Jul 08, 2014 7:49 am Post subject: |
|
|
Novice
Joined: 09 Jun 2010 Posts: 19
|
Hi Jedi,
I did try that but FileRead node doesn't have FTP capability? what do you say?
Thanks
ARaj |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 08, 2014 8:05 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MQ_user1 wrote: |
I did try that but FileRead node doesn't have FTP capability? |
So it doesn't. You learn something new every day.
MQ_user1 wrote: |
what do you say? |
You're hosed.
As my worthy associate noted, the FileInput node cannot be used in the middle of a flow. Or sub flow. You also can't change the path used by the FileInput node in the way you describe, i.e. based on the content of a message. See above re: "cannot be used in the middle of a flow" _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
MQ_user1 |
Posted: Tue Jul 08, 2014 8:25 am Post subject: |
|
|
Novice
Joined: 09 Jun 2010 Posts: 19
|
Thanks Vitor.
As you all suggested that it wouldn't be possible to implement using compute node and I'm not an expert in Java using JavaCompute. Probably I'll inform my manger I can't help in this.
Thanks
ARaj |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 08, 2014 9:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MQ_user1 wrote: |
I'm not an expert in Java using JavaCompute. |
Do not attempt to open files / queues / databases / external resources from a Java Compute node.
At best you'll play havoc with the broker's transaction handling, at worst it will come down round your ears. In both situations it may appear to work for a while, but this will introduce unpredicable instability.
Broker is not WAS. Writing Java that runs inside Broker assuming it works like WAS is doomed to fail. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
MQ_user1 |
Posted: Tue Jul 08, 2014 9:53 am Post subject: |
|
|
Novice
Joined: 09 Jun 2010 Posts: 19
|
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jul 08, 2014 10:08 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It's a poor idea to try and write a JavaCompute node that accesses files over FTP - but only because accessing files over FTP is a much harder problem than it looks.
It's generally not *dangerous* to read and write files from a JavaCompute node, although it's always possible for a developer to code it dangerously.
it's generally not *dangerous* to use JDBC from a JavaCompute node.
it's generally not *dangerous* to access "external resources" from a JavaCompute node - depending on the type of resource...
It's always dangerous to access the broker's local queue manager from a JavaCompute node! (no guarantee is made on the truth of this statement against IIB v10) |
|
Back to top |
|
 |
MQ_user1 |
Posted: Tue Jul 08, 2014 10:15 am Post subject: |
|
|
Novice
Joined: 09 Jun 2010 Posts: 19
|
What is the preferred solution in this case?
any use of MQ FTE in this scenario? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 08, 2014 10:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
It's generally not *dangerous* to read and write files from a JavaCompute node, although it's always possible for a developer to code it dangerously. |
If the files are local and therefore do not need FTP, they move into range of the FileRead node
mqjeff wrote: |
it's generally not *dangerous* to use JDBC from a JavaCompute node.
it's generally not *dangerous* to access "external resources" from a JavaCompute node - depending on the type of resource... |
I will politely disagree here, and point out a) any developer can make anything dangerous b) this kind of home brew cannot exploit the inbuilt admin and management facilities for these resources. Hence the TCO goes up, and the danger increases (with hard coded JDBC in JCNS, that sort of thing).
mqjeff wrote: |
It's always dangerous to access the broker's local queue manager from a JavaCompute node! (no guarantee is made on the truth of this statement against IIB v10) |
Totally agree, and so far as I understand it the statement remains true for IIBv10.
(I am not now nor have I ever been part of the IIBv10 development team, IIBv10 could contain any feature or combination of features including a cage for flying monkeys and will do what it does at the sole discression of IBM as announced according to their discression) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 08, 2014 10:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MQ_user1 wrote: |
What is the preferred solution in this case? |
Code.
MQ_user1 wrote: |
any use of MQ FTE in this scenario? |
Don't see how. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
MQ_user1 |
Posted: Tue Jul 08, 2014 10:45 am Post subject: |
|
|
Novice
Joined: 09 Jun 2010 Posts: 19
|
Hi,
One more last option for me to check.
Will it be any useful If we use MQ + HTTP protocol ? having apache server at files side.
I don't think web service call will make any use in this scenario as well.
If we have to think about web service calls then that has to be implemented where files actually resides. Isn't it? Correct me If I'm wrong.
Thanks
ARaj |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jul 08, 2014 10:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
FTE could be used.
There's no sense in talking about a 'preferred' solution outside of your own site preferences.
A managed file transfer solution, like FTE, that can put files in a place where IIB can read them is a more manageable solution than bespoke code. |
|
Back to top |
|
 |
|