Author |
Message
|
edgar.maistry@tsctechnolo |
Posted: Thu Sep 09, 2010 5:56 am Post subject: Dynamically set FTP server name using eSQL on Broker 7 |
|
|
Newbie
Joined: 19 Dec 2005 Posts: 3
|
Hello,
I would like to set the 'server and port' property on the FTP tab of the FileOutput node dynamically using esql (localenvironment). I cannot find documentation for Broker 7 to do this. Is it possible? Any help appreciated |
|
Back to top |
|
 |
mqmatt |
Posted: Thu Sep 09, 2010 7:15 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
It's a bad idea to do this, as an FTP server is operational configuration, whereas ESQL files are application development assets.
You don't want to have to recompile, retest and redeploy your message flows when an IP address changes... or when you move between dev/test/QA/prod environments.
Use configurable services instead. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 09, 2010 7:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So suppose I have a database table that contains a list of customers and their associated ftp service information.
How do I define a configurable service that will use that information?
Conversely, how do I define a message flow such that I can alter the configurable service in use based on that information? |
|
Back to top |
|
 |
mqmatt |
Posted: Thu Sep 09, 2010 8:49 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
You can modify configurable services and their properties using a JavaCompute node, or an ESQL Compute node calling out to Java.
Code: |
...
BrokerProxy b = BrokerProxy.getLocalInstance();
ConfigurableService c = b.getConfigurableService(...);
c.setProperty(...);
... |
Note that some configurable services require you to mqsireload the execution group when you change a configurable service property.
(The FileOutput node doesn't currently cope with outputting to different FTP servers on a message-by-message basis; it is on the candidate list for a future release, but you should still raise a requirement if it's something you need.) |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 09, 2010 9:21 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mqmatt wrote: |
The FileOutput node doesn't currently cope with outputting to different FTP servers on a message-by-message basis; |
I think this is the information that edgar.maistry@tsctechnolo was looking for.
I suppose probably the WMQ FileTransfer Edition can assist here, but I'm not sure. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Sep 09, 2010 9:51 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Here are two out-of-the-box thoughts that may help:
If nothing else works, you could try using a RouteToLabel node to route your message. While it won't give you truly dynamic routing, if you have only several dozen FTP servers you ever send to, you could create a label / leg for each server and route appropriately.
Another option is coding an FTP client in a JCN.
None of these are optimum, but better than nothing. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
MrSmith |
Posted: Wed Jul 17, 2013 6:24 am Post subject: |
|
|
 Master
Joined: 20 Mar 2008 Posts: 215
|
Does anybody know if this is still the case - I have a situation whereby I want to change the sftp server dynamically based on which environment the flow is deployed into (having retrieved from DB), there was mention that it might be a future thing
Quote: |
it is on the candidate list for a future release, but you should still raise a requirement if it's something you need.) |
I see that config service loads the config at start of flow (by start do they mean stop / start or do they mean beginning of UOW?????). _________________ -------- *
“Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.” |
|
Back to top |
|
 |
zpat |
Posted: Wed Jul 17, 2013 6:27 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
What's wrong with the WMB configurable service being set in each environment to the appropriate value for the FTP server?
Seems better to keep code and environment values apart. Having the code determine where it's running and setting values - is sort of saying that IBM's configurable service needs improving - in what way? |
|
Back to top |
|
 |
MrSmith |
Posted: Wed Jul 17, 2013 6:32 am Post subject: |
|
|
 Master
Joined: 20 Mar 2008 Posts: 215
|
zpat - Cos i not only have different IP addresses in each environment but also different ip addresses based on message content, this is for a high street bank with more than one brand the incoming message contains multi brand content each needs to be sifted to the correct server, additionally one Broker serves multi environments test, uat etc so need to be able to route accordingly. JCN isn't an option they don't use JCN. _________________ -------- *
“Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.” |
|
Back to top |
|
 |
zpat |
Posted: Wed Jul 17, 2013 6:48 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You could route control to different fileoutput nodes I guess. Assuming that there aren't hundreds of these
Or maybe the configurable service name (itself) could be set in ESQL? |
|
Back to top |
|
 |
MrSmith |
Posted: Wed Jul 17, 2013 8:20 am Post subject: |
|
|
 Master
Joined: 20 Mar 2008 Posts: 215
|
yeah the first option i had thought of as plan B and its not many fileoutputs but its just not pretty and leaves it open if you need to add more etc.
well i am looking at that cos the docs say that you can put the config service name in the server and port on FTP tab which either means it "grabs" then details on flow start or maybe dynamic there??
I would like to make this a formal request to have this functionality in a near future release anybody at hursley who reads this if you can set the file name and directory then why not the server details dynamically??? PLEEEEEEEASE _________________ -------- *
“Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.” |
|
Back to top |
|
 |
mgk |
Posted: Wed Jul 17, 2013 8:34 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
|
Back to top |
|
 |
zpat |
Posted: Wed Jul 17, 2013 8:39 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Very nice, but is this IIB 9.0 only?
When did the option to specify LocalEnvironment.Destination.File.Remote.Server come in?
If it's not in your version you could send the message to different output queue names perhaps (assuming the output queue name can be set dynamically) by appending the FTP config service name to the end of the queue name,
Then code a tiny flow for each queue name to send to that FTP destination. So the main flow would be unchanged when a new dest is added - just create the additional queue and the new (tiny) flow to send it to the new destination FTP server. |
|
Back to top |
|
 |
MrSmith |
Posted: Wed Jul 17, 2013 8:59 am Post subject: |
|
|
 Master
Joined: 20 Mar 2008 Posts: 215
|
mgk - interesting cos i read that in the V7 docs but have been unable to get it to work, does it also work for regardless of server type (i.e.sftp and ftp)?
zpat - this is in V7 already according to docs, you idea (if i understood correctly) of seperate queues for each server would not work in the case of a appending records to "open" files or sending as whole file because each context that requires a different queue would then be sending message as seperate UOW and would not know of its previous siblings destination _________________ -------- *
“Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.” |
|
Back to top |
|
 |
zpat |
Posted: Wed Jul 17, 2013 10:54 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
I believe that the finalize file (terminal on file output node) will work over separate units of work. It's not until you tell WMB to finalize (send) the file, does it actually move it from mqsitransit and FTP it.
Apparently this works across different flows invocations or even over broker restarts. Easy enough to try it out. |
|
Back to top |
|
 |
|