Author |
Message
|
MichaelBulla |
Posted: Mon Oct 09, 2006 7:44 am Post subject: Creating a listener in MQ from inside an application |
|
|
Apprentice
Joined: 27 Sep 2006 Posts: 31 Location: Hamburg/Germany
|
Hi,
Im trying to configure MQ from an installer for my application. I use crtmqm to create a queuemanager and strmqm to start it. Now I want to create a listener and a channel.
As long as there is no channel and listener, I cant use PCF. And I didnt find a way to pass the command directly to runmqsc. And I dont want to create a tempfile to use runmqsc < tempfile. Is there a better way to create a listener?
Best regards Michael |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Oct 09, 2006 7:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You don't need to use a file to pipe input into runmqsc.
You just need to know how to read and write from the standard in and standard out of the child process.
Or you could make the child process the equivalent of
Code: |
echo 'define listener(LISTENER.TCP) trptype(TCP) port(1414)'|runmqsc qmgrname |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
MichaelBulla |
Posted: Mon Oct 09, 2006 7:52 am Post subject: |
|
|
Apprentice
Joined: 27 Sep 2006 Posts: 31 Location: Hamburg/Germany
|
Pipe, of course
Thanks
Edit: After first euphoria I see, that using pipes and other special Shell-operators from java-applications is quite tricky, too.
Is there an even better way? |
|
Back to top |
|
 |
vennela |
Posted: Mon Oct 09, 2006 9:14 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Why are you doing it from a java program anyway? |
|
Back to top |
|
 |
MichaelBulla |
Posted: Mon Oct 09, 2006 11:19 pm Post subject: |
|
|
Apprentice
Joined: 27 Sep 2006 Posts: 31 Location: Hamburg/Germany
|
Im writing an installer for an application that uses MQ. The installer has to do a lot of things dynamically, so a script wont suffice. |
|
Back to top |
|
 |
Nigelg |
Posted: Tue Oct 10, 2006 12:39 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Since your chosen tool (java) does not support the easy way, why not use another tool that does, like writing the program in C for example? _________________ MQSeries.net helps those who help themselves.. |
|
Back to top |
|
 |
MichaelBulla |
Posted: Tue Oct 10, 2006 12:52 am Post subject: |
|
|
Apprentice
Joined: 27 Sep 2006 Posts: 31 Location: Hamburg/Germany
|
Using java is a politically decision.
And the insaller should work os-independent. Thats why using os-operators ist tricky. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 10, 2006 2:12 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
But the act of installation is going to be os-dependent, to a large extent.
So you will have to encode some os-specific information in your code and detect the OS and take different steps based on which OS you're running on.
You could look into using Ant, either externally or from within your java code. It might make this simpler. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|