|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
IBM WebSphere, Any callback for reading text - put test msg. |
« View previous topic :: View next topic » |
Callback function for reading messages from websphere |
c++,vc++, com |
|
0% |
[ 0 ] |
c++,vc++, com |
|
0% |
[ 0 ] |
|
Total Votes : 0 |
|
Author |
Message
|
Nani_26 |
Posted: Mon Jul 26, 2010 6:40 am Post subject: IBM WebSphere, Any callback for reading text - put test msg. |
|
|
Newbie
Joined: 21 Jul 2010 Posts: 3
|
Hi! All/Experts,
can any one confirm regarding any callback function for reading the text messages from websphere.
do we have any callback function for reading the text messages once any one hit the put message button on the IBMWebsphere's put test message dialog.
current i wrote a infinite while loop that ping's(every time i call MQGet function to read the size then read the data) websphere to read the data.
does web sphere has any callback function so that we can pass the address of our function, whenever anyone puts messages so that we can read only at that time.
this makes that we read the messages correctly.
please reply to this ASAP.
i |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jul 26, 2010 7:14 am Post subject: Re: IBM WebSphere, Any callback for reading text - put test |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Nani_26 wrote: |
can any one confirm regarding any callback function for reading the text messages from websphere. |
Yes - it's called callback.
Nani_26 wrote: |
do we have any callback function for reading the text messages once any one hit the put message button on the IBMWebsphere's put test message dialog. |
Yes - oddly enough the same thing.
Nani_26 wrote: |
current i wrote a infinite while loop that ping's(every time i call MQGet function to read the size then read the data) websphere to read the data. |
Why? You know the maximum possibly size of the message (for buffer purposes) before you even do a get & the get returns actual message size.
Nani_26 wrote: |
does web sphere has any callback function so that we can pass the address of our function, whenever anyone puts messages so that we can read only at that time. |
Yes - for the third time.
Nani_26 wrote: |
this makes that we read the messages correctly. |
No it doesn't. It's just a design pattern you might or might not want to use.
And why make this a poll???  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Nani_26 |
Posted: Mon Jul 26, 2010 10:31 pm Post subject: IBM WebSphere, Any callback for reading text - put test msg. |
|
|
Newbie
Joined: 21 Jul 2010 Posts: 3
|
Hi!,
i had verified the mqm.dll it has no function with the name 'callback', it only exports MQGET.MQPUT, MQOPEN, MQINQ.
i called MQGet twice, 1st time to get the size & 2nd time to get the buffer.
mqget(, , , ,, , isize, lbuffer)//here i got isize
mqget(, , , ,, , isize, lbuffer)//here i got the buffer.
in my case whenever i put the xml text on "put test message" dialogs edit box and invoked the "put message " button, its not reading the buffer. in random cases iam able to read the buffer from websphere.
can't we read the messages without the infinte loop that keeps of calling mqget to read the data.
ex.,
any mq's function that takes any function address, we pass our function address.
MQSomeFun(, , (void*)(thattakes_functionaddress))
void thattakes_functionaddress()
{
i am waiting here to catch the messages
} |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 27, 2010 4:01 am Post subject: Re: IBM WebSphere, Any callback for reading text - put test |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Nani_26 wrote: |
i had verified the mqm.dll it has no function with the name 'callback', it only exports MQGET.MQPUT, MQOPEN, MQINQ. |
My bad - assumed you were using WMQv7. No reason from your post I should. If you're not, there's no such function.
Nani_26 wrote: |
i called MQGet twice, 1st time to get the size & 2nd time to get the buffer.
mqget(, , , ,, , isize, lbuffer)//here i got isize
mqget(, , , ,, , isize, lbuffer)//here i got the buffer. |
Why?
Nani_26 wrote: |
in my case whenever i put the xml text on "put test message" dialogs edit box and invoked the "put message " button, its not reading the buffer. in random cases iam able to read the buffer from websphere. |
Sounds like a code bug to me.
Nani_26 wrote: |
can't we read the messages without the infinte loop that keeps of calling mqget to read the data. |
Not below v7.
And don't write infinite loops without proper error trapping & a means to exit. At best you'll annoy whoever administers your queue manager. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Nani_26 |
Posted: Wed Jul 28, 2010 12:28 am Post subject: IBM WebSphere, Any callback for reading text - put test msg. |
|
|
Newbie
Joined: 21 Jul 2010 Posts: 3
|
i use IBM Websphere version 6.0
when we use MQGet we also need to specify the size if not it will [may be] give us the size only not the buffer, for this reason i called first to get actual buffer size.
Can u also clarify me on below
i use user defined classes[that is class design of my project] to put,get the messages from/to websphere. All this stuff i had done in a static library.
& my process iam using the user-defined functions to get the message.
my functin is Message* Get();
after the function returns from lib i cant use the buffer in it, the char* varibale of Message class shows the data but when i copy that into some other varible its not getting copied.
its behaving as empty char*, how to track this sort of issue. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 28, 2010 3:59 am Post subject: Re: IBM WebSphere, Any callback for reading text - put test |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Nani_26 wrote: |
iwhen we use MQGet we also need to specify the size if not it will [may be] give us the size only not the buffer, for this reason i called first to get actual buffer size. |
This 1st call is unnecessary. Think about it.
Nani_26 wrote: |
how to track this sort of issue. |
This is a code problem not a WMQ one; there's a problem in this function you've wrapped round the WMQ call. Any of the standard methods will help. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|