Author |
Message
|
antishok |
Posted: Tue Jul 17, 2007 5:48 am Post subject: xms queuebrowser not retrieving large (>256k) messages |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 31
|
Hey,
I am using XMS for C++, connecting to a remote queue manager
when I use a MessageConsumer to receive any messages from my queue, it works fine, but I only want to browse
with a QueueBrowser, hasNext() of the xms::Iterator returns false
sometimes when there are messages in the queue (that a regular receive DOES receive)
I've done some testing and it seems that it only fails to retrieve the messages when their size is larger than around 256k bytes
(The message data is just some file data.. format MQSTR)
Any ideas, please?
Thank you
Uri Gilad,
YCD
Last edited by antishok on Mon Jul 23, 2007 7:12 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 17, 2007 6:04 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
The messages can't have been committed between browse and read I suppose?
So you browse this queue, method returns false. You use a recieve method and get a message. MsgId and CorrelId are set identically in both instances, buffer is sufficient, all that good stuff? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
antishok |
Posted: Tue Jul 17, 2007 6:19 am Post subject: |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 31
|
I'm creating both the MessageConsumer and the QueueBrowser with no message selector, for now, so it should receive all messages I suppose
no commits, rollbacks, transactions |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 17, 2007 6:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Well 260k is no size for a message so it's unlikely to be a space issue.
Nope, no more ideas. It does work (or works for me) so there's a code / configuration / message issue someplace, but nothing jumps out.
Someone brighter will be along in a minute.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 17, 2007 6:56 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No errors listed in MQ error logs, maybe problems with the client channel?
No exceptions thrown, just hasNext() returns false?
Are you starting with an empty queue, starting your browse and then putting messages? Are you starting with messages on the queue, and trying to browse them?
Is there something else on QueueBrowser one needs to do to advance the cursor, other than call hasNext() on the Iterator?
Also, are you sure you need to Browse in the first place? maybe you can use a syncpoint instead? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
antishok |
Posted: Tue Jul 17, 2007 7:14 am Post subject: |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 31
|
No errors in MQ logs..
No exceptions, just hasNext() returns false
I'm starting with a queue that already has message(s)
According to the docs there's nothing to do for advancing the cursor..
just the ol' hasNext() / getNext()
Not sure what a syncpoint is.. i'll check it out
Also -
If I put a small message on the empty queue, (which can be read by the queuebrowser)
but then I add some large messages (>260k)
then the first getNext() returns the small message which is ok
but then.. hasNext() keeps returning true, and getNext() keeps returning the SAME short first message.. something very fishy is going on |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 17, 2007 7:50 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
....
I'd make sure you're using the latest version of XMS, first off.
Secondly, it sounds like your code may not be properly clearing the message between GETs, somehow.
Can we see snippets - mainly the framework of your loop? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
antishok |
Posted: Tue Jul 17, 2007 7:53 am Post subject: |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 31
|
I have the latest version of XMS, just started working with it last week,
there IS no loop, I just connect and grap the message
I'll post the code later, gotta jet,
thank you for the replies
keep em coming  |
|
Back to top |
|
 |
antishok |
Posted: Sun Jul 22, 2007 4:52 am Post subject: |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 31
|
some of the relevant snippets:
Code: |
xms::InitialContext i;
i.create("file://c:\\Program Files\\IBM\\JMSAdmin Tool\\cds\\.bindings");
d = dynamic_cast<xms::Destination *>(i.lookup("outgoingContentQueue2"));
xms::QueueBrowser receiver = m_sess.createBrowser(*d);
xms::Iterator i = receiver.getEnumeration();
if ( i.hasNext() == xmsTRUE )
txt = reinterpret_cast<xms::TextMessage *>(i.getNext());
|
|
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Jul 22, 2007 12:24 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I see one flaw in this. You have no guarantee that the next message > 256K is a text message. Just cast to a Message and check that the class is of TextMessage. Don't know how it would behave if the message is not a text message...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
antishok |
Posted: Mon Jul 23, 2007 4:06 am Post subject: |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 31
|
hasNext returns false.
I don't even get to cast the message. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jul 23, 2007 4:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Where are you looping back over hasNext? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
antishok |
Posted: Mon Jul 23, 2007 7:09 am Post subject: |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 31
|
as I've stated, there is no loop
can't even browse one message |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jul 23, 2007 7:13 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Now I'm confused.
antishok wrote: |
there is no loop |
antishok wrote: |
the first getNext() returns the small message which is ok
but then.. hasNext() keeps returning true, and getNext() |
Are you starting an entirely new instance of your program each time? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
antishok |
Posted: Mon Jul 23, 2007 7:50 am Post subject: |
|
|
Apprentice
Joined: 29 Apr 2007 Posts: 31
|
yes, there was a case where i was just testing,
where I put one small message on the queue followed by a few large ones, and the hasNext() kept returning true, and the getNext() kept returning the first small message..
I don't even have this code anymore because I was just playying around, hell, it wasn't even a loop, just a few calls to hasNext/getNext |
|
Back to top |
|
 |
|