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 » General IBM MQ Support » Messages lost when application putting very fast.

Post new topic  Reply to topic Goto page Previous  1, 2
 Messages lost when application putting very fast. « View previous topic :: View next topic » 
Author Message
WMBDEV1
PostPosted: Mon Jun 22, 2009 3:47 am    Post subject: Reply with quote

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
View user's profile Send private message
betterchoices
PostPosted: Mon Jun 22, 2009 4:03 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Mon Jun 22, 2009 5:31 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Tue Jun 23, 2009 5:42 am    Post subject: Reply with quote

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
View user's profile Send private message
exerk
PostPosted: Tue Jun 23, 2009 6:02 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Tue Jun 23, 2009 6:13 am    Post subject: Reply with quote

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
View user's profile Send private message
exerk
PostPosted: Tue Jun 23, 2009 6:20 am    Post subject: Reply with quote

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
View user's profile Send private message
WMBDEV1
PostPosted: Tue Jun 23, 2009 6:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Jun 23, 2009 7:40 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Tue Jun 23, 2009 7:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Jun 23, 2009 7:51 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Tue Jun 23, 2009 8:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » General IBM MQ Support » Messages lost when application putting very fast.
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.