ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Script to send a request to MQ

Post new topic  Reply to topic Goto page 1, 2  Next
 Script to send a request to MQ « View previous topic :: View next topic » 
Author Message
Aishu
PostPosted: Wed Mar 10, 2010 8:54 am    Post subject: Script to send a request to MQ Reply with quote

Newbie

Joined: 10 Mar 2010
Posts: 2

Hi,

Can anyone please help me for the following?

I have an application which should send request to MQ for every 4 minutes so that the channel never becomes inactive. I should write a script for this.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 10, 2010 9:09 am    Post subject: Re: Script to send a request to MQ Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Aishu wrote:
I have an application which should send request to MQ for every 4 minutes so that the channel never becomes inactive. I should write a script for this.


No you shouldn't. Unless you have a really, really good reason for the channel not to become inactive. In which case you should configure the channel not to become inactive.

But before you do that I recommend you read some of the discussions in this forum about channels that don't disconnect. A channel that never becomes inactive is a channel very likely to cause you problems and should only be used for a very compelling reason.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Aishu
PostPosted: Wed Mar 10, 2010 9:42 am    Post subject: Script to send a request to MQ Reply with quote

Newbie

Joined: 10 Mar 2010
Posts: 2

Thanks a lot. I will not do that as it is not a good practice.

But I should write a script that makes a request to the application every 4 minutes. Can u pls help?

Thanks in advance.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 10, 2010 10:03 am    Post subject: Re: Script to send a request to MQ Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Aishu wrote:
But I should write a script that makes a request to the application every 4 minutes. Can u pls help?


I'm having trouble seeing the requirement here. If you have application A which needs to send a request to application B every 4 minutes via WMQ, then presumably application B already has the ability to send a request via WMQ and it just needs to do it every 4 minutes using an internal timer/cron/OS scheduler/etc

What's the script for?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Mar 10, 2010 10:21 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

I'm guessing that you want to ensure that the channel is already in RUNNING state when it will be needed next. Is this correct?

There has been lots of discussion about this very issue here on mqseries.net.

RUNNING indicates that at this precise moment the channel is transmitting messages, OR that the channel believes that it can transmit messages when next it tries. There is no guarantee that the next time the channel tries, that it will be able to transmit messages.

Triggering a channel is usually sufficient to keep channels up and running. There is no need to write and run an application to do this.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
lash
PostPosted: Wed Mar 10, 2010 1:34 pm    Post subject: Reply with quote

Apprentice

Joined: 14 May 2003
Posts: 47

Aishu,
use the ibm supplied java program to send and receive a test msg.
put the test msg to a test queue.
to make this java program send msg every 4 min. you can have 2 methods.
1=use cron job to run this java program every 4 min.
or
2=alter existing supplied java program to send msg every 4min.

option1 is easy==contact ur unix admins guys to make this happen. its their job.
option2 needs some java skills.

hope this will make your life easy at work and make your boss happy.

cheers,
lash.
Back to top
View user's profile Send private message
exerk
PostPosted: Wed Mar 10, 2010 2:25 pm    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

lash wrote:
Aishu,
use the ibm supplied java program to send and receive a test msg.
put the test msg to a test queue.
to make this java program send msg every 4 min. you can have 2 methods.
1=use cron job to run this java program every 4 min.
or
2=alter existing supplied java program to send msg every 4min.


Don't! This will open up a whole world of hurt...

lash wrote:
option1 is easy==contact ur unix admins guys to make this happen. its their job.


No, it's not. It is no ones job to satisfy a needless and pointless requirement.

lash wrote:
...hope this will make your life easy at work and make your boss happy.


This will not make his life happy, nor that of the unix Sys Admins, when the queue manager is down and the job keeps on trying to fire, nor will his boss be happy when their boss bites.

Consider - What messages are you going to put? Do you think the applications people are going to be happy when a spurious message arrives every four minutes? Who is going to turn on/off the cron job when you have to take down the queue manager? And the list of questions goes on and on...

If there is a valid business reason for a continuously running channel, let the business justify that decision, document it, and allow you to provide a properly maintainable solution.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Mar 10, 2010 2:55 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

There is a difference between a business requirement and a technical solution.

"Implement a process that ensures that channels are available as needed" is an example of a business requirement. It is non-specific; and allows the sysadmin to use none, one, some or all, of the tools available - allowing for technical analysis, and based on what best satisfies the requirement.

"Write an application, and execute it every 4 minutes to ensure that the channel is operating" is an example of a technical solution. It is specific, and doesn't allow for sysadmins to make or suggest a better choice.

So, what is the business requirement?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 10, 2010 7:45 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lash wrote:
hope this will make your life easy at work and make your boss happy.


Up to the point the test queue fills up. When messages will start leaking onto the dead letter queue, which will then fill up. At which point the channel will leave it's RUNNING start and stop. At which point no-one's life will be easy, and many bosses will be very upset.

If you're going to suggest solutions, try thinking them through first.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 10, 2010 8:25 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Ah the wonder of triggered channels...
Like the children of the bygone Victorian area,
To be admired but not heard,
Always running when needed,
And silent and quiet when idle.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Thu Mar 11, 2010 6:23 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fjb_saper wrote:
Ah the wonder of triggered channels...
Like the children of the bygone Victorian area,
To be admired but not heard,
Always running when needed,
And silent and quiet when idle.



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Mar 11, 2010 6:35 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Another solution in search of a problem to resolve...
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Thu Mar 11, 2010 2:26 pm    Post subject: Re: Script to send a request to MQ Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

Aishu wrote:
Hi,

Can anyone please help me for the following?

I have an application which should send request to MQ for every 4 minutes so that the channel never becomes inactive. I should write a script for this.


What type of channel are you talking about? The usual solution is to set the DISCINT() to at least twice as long as the typical interval between messages that go across the channel. eg. If there is about 1 message every hour, set DISCINT(7200).
_________________
Glenn
Back to top
View user's profile Send private message
gunter
PostPosted: Fri Mar 12, 2010 12:13 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2004
Posts: 307
Location: Germany, Frankfurt

Hi,

Aishu asked for a way to send messages by an script and I think, it is not so niche to get ten posts on this thread and only one tries to answer.

Even if it is the worst solution to hold a channel running by sending alive messages, whoever posts should try to give an answer to the question.

I know only one scripting language for MQ, Perl. You'll find it on CPAN.
or
Seach the IBM site, maybe you can find something in the supportpacks.
or
Use a programming language of your choice:
C, C++, Java, C#, ...
The samples, delivered with the product or on this site may help.

But I agree with the other answers in this thread: Don't do it.
_________________
Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Mar 12, 2010 1:04 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

gunter wrote:
...Aishu asked for a way to send messages by an script and I think, it is not so niche to get ten posts on this thread and only one tries to answer...


I prefer to think of it as Aishu getting nine answers, ten if you include yours, all saying the same thing. Aishu can then go back to management and say "..this 'requirement' is not a good thing..." and have a fair chance of success either in not implementing it all, or doing so in a structured way that makes the business realise it's not a trivial exercise, and will probably cost them more than they think.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Script to send a request to MQ
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.