Author |
Message
|
WMBDEV1 |
Posted: Mon Jun 22, 2009 3:47 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
I had to knock up a quick message producer and so used the code snippet provided previously. Works fine for me.
I've put 5000 6k xml messages.
Code: |
import java.io.BufferedReader;
import java.io.FileReader;
import com.ibm.mq.MQC;
import com.ibm.mq.MQGetMessageOptions;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
public class GenerateMessages {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
MQQueueManager qm = null;
MQQueue out = null;
BufferedReader in = null;
try
{
in = new BufferedReader(new FileReader("c:/xml/test.xml"));
StringBuffer message = new StringBuffer();
String line = in.readLine();
while(line!=null)
{
message.append(line);
line = in.readLine();
}
qm = new MQQueueManager("WBRK61_DEFAULT_QUEUE_MANAGER");
out = qm.accessQueue("IN", MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);
for(int i=0; i<5000;i++){
MQMessage msg = new MQMessage();
msg.format = MQC.MQFMT_STRING ;
msg.writeString(message.toString()); // message is my message
MQPutMessageOptions pmo = new MQPutMessageOptions();
out.put(msg, pmo); // queue is my MQ Queue.
}
qm.commit();
}catch(Exception e)
{
qm.backout();
System.out.println("Error: " +e);
}
finally
{
if(in !=null)in.close();
if(out!=null)out.close();
if(qm!=null)qm.close();
}
}
}
|
MQVer 6.0.2.5 |
|
Back to top |
|
 |
betterchoices |
Posted: Mon Jun 22, 2009 4:03 am Post subject: |
|
|
Novice
Joined: 08 Jun 2009 Posts: 18
|
My system was idle for the past 2 days.
I am using the same code, I posted earlier, and now everything works.
I really dont know why there was issue with same code 2 days back.
Today it works, I send 5000, and 5000 reached Queue(for both Code 1 and Code 2).
I am really sorry for wasting so much of time of you all.
I sincerely apologize for the inconvinience caused.
But trust me, there was issue for continous 1 day. i tested 100 times before posting the issue on MQSeries.net, Now that issue is resolved. I really feel bad about wasting so much time of u all.
I am checking for all possibilities why the code was not working that day.
Thanks you so much for all that support from this forum.
Quote: |
I had to knock up a quick message producer and so used the code snippet provided previously. Works fine for me. |
Yes similar was my code also, and today it is working for me, I can't understand why it was not working 2 days back.
Thanks _________________ In god we trust.
Rest is all Data. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Jun 22, 2009 5:31 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
i tested 100 times before posting the issue |
It seems to me that you did not really test - in the sense that you just kept compiling and executing, hoping for different results.
Testing implies a structured methodology of trial and error based some hypothesis.
You omitted capturing known variable data (Completion and Reason Codes). You didn't vary other variables (number of messages, max queue depth).
Your original analysis - random results - is now confirmed by your observation that your code is working today - as if by magic.
Vitor's frustration (and mine) is from your refusal to answer question, and your apparent lack of understanding of WMQ messaging and queuing. _________________ 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 |
|
 |
bruce2359 |
Posted: Tue Jun 23, 2009 5:42 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
WMBDEV1 says: ...to knock up...
Gawd, how I love the English language!
This must be one of those idiomatic expressions. I've heard this used (in England) to mean stop by and wake me up; as in "Knock me up in the morning."
In US, to knock up means to get (someone) pregnant. As in "I got knocked up by that SOB Steve at the company picnic."
This little piece of business made the post much more interesting for me.  _________________ 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 |
|
 |
exerk |
Posted: Tue Jun 23, 2009 6:02 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
bruce2359 wrote: |
WMBDEV1 says: ...to knock up...
Gawd, how I love the English language!
This must be one of those idiomatic expressions. I've heard this used (in England) to mean stop by and wake me up; as in "Knock me up in the morning."
In US, to knock up means to get (someone) pregnant. As in "I got knocked up by that SOB Steve at the company picnic."
This little piece of business made the post much more interesting for me.  |
English(isms):
...to knock up...
1. Rouse from slumber etc.
2. Get pregnant
3. Quickly put together
I'm impressed, you got two out of the three
EDIT: PS - can I please come to one of your company picnics? _________________ 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 |
|
 |
bruce2359 |
Posted: Tue Jun 23, 2009 6:13 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
3. Quickly put together
This one is usually (from my experience) knock out or knock off.
The company picnic has been cancelled this year for financial reasons. _________________ 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 |
|
 |
exerk |
Posted: Tue Jun 23, 2009 6:20 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
bruce2359 wrote: |
3. Quickly put together
This one is usually (from my experience) knock out or knock off.
The company picnic has been cancelled this year for financial reasons. |
Going completely now (so expect a slap from my master...)
...knock out...
1. Stunning example of the female of the species.
2. Render unconscious.
...knock off...
1. Steal.
2. Counterfeit (as in, 'to knock off a copy'). _________________ 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 |
|
 |
WMBDEV1 |
Posted: Tue Jun 23, 2009 6:50 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
bruce2359 wrote: |
WMBDEV1 says: ...to knock up...
Gawd, how I love the English language!
This must be one of those idiomatic expressions. I've heard this used (in England) to mean stop by and wake me up; as in "Knock me up in the morning."
In US, to knock up means to get (someone) pregnant. As in "I got knocked up by that SOB Steve at the company picnic."
This little piece of business made the post much more interesting for me.  |
I am familiar with the other uses you mentioned there. I used it in the sense of.... its really quick and dirty code so please dont tell me I haven't wrapped my .close() methods in exceptions etc etc. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 23, 2009 7:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
The company picnic has been cancelled this year for financial reasons. |
False economy IMHO
exerk wrote: |
Going completely now (so expect a slap from my master...) |
exerk wrote: |
...knock out...
1. Stunning example of the female of the species.
2. Render unconscious.
|
Which can be used in combination to great effect if you lack social skills....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zpat |
Posted: Tue Jun 23, 2009 7:45 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Knock it off you lot....
(means stop doing what you are doing). |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 23, 2009 7:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jun 23, 2009 8:20 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
...boys just wanna have fu-un. _________________ 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 |
|
 |
|