Author |
Message
|
bijesh |
Posted: Wed Feb 28, 2007 4:36 am Post subject: MQMessage to MbMessage |
|
|
Acolyte
Joined: 30 Jan 2007 Posts: 66
|
Hi,
I'm making use of a Java compute node to read messages from a queue. The message is of MQMessage type.
But if I need to propagate it from Java compute node , the message need to be of type MbMessage. Any thoughts on this.
Regards,
Bijesh |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 28, 2007 4:39 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Why can't you use the MQGet node instead?
The documentation has information on how to create a new message, did that not apply to your particular case somehow? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bijesh |
Posted: Wed Feb 28, 2007 4:58 am Post subject: |
|
|
Acolyte
Joined: 30 Jan 2007 Posts: 66
|
Did thought about the MQGet node. But since I'd to do some Queu operations like, getCurrentDepth, getMaximumDepth etc. settled for Java Compute node. |
|
Back to top |
|
 |
au@kosa |
Posted: Wed Feb 28, 2007 4:59 am Post subject: |
|
|
 Centurion
Joined: 04 Jan 2007 Posts: 103 Location: pune
|
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 28, 2007 5:23 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What are you actually trying to do?
There's almost never any reason for a non-monitoring program to care about the current depth of a queue or the maximum depth of a queue. That you are thinking of getting this information raises many red flags that you are trying to do something "the wrong way" for MQ. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bijesh |
Posted: Wed Feb 28, 2007 5:33 am Post subject: |
|
|
Acolyte
Joined: 30 Jan 2007 Posts: 66
|
Can't I make use of MQ APIs from Java compute node?
What I'm trying to do
I want to get the messages from a queue. I need to have a look at the current depth of the queue as well.
So i'm making use of Java compute node. From Java compute node I need to propagate the message that is read from the queue to the next node.
Now the message I get after reading from the queue will be of MQMessage type. But if i want to propagate it from the Java compute node, the message should be of type MbMessage.
Hope I'd stated the problem properly. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 28, 2007 5:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
WHY do you need to look at the current depth of the queue?
Yes, you *can* do this.
It's not clear that you *should* do this. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bijesh |
Posted: Wed Feb 28, 2007 5:41 am Post subject: |
|
|
Acolyte
Joined: 30 Jan 2007 Posts: 66
|
WHY do you need to look at the current depth of the queue?
That is due to the design constraint.
Yes, you *can* do this.
using MQ APIs?
It's not clear that you *should* do this.
What are the implications If I use the MQ APIs? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 28, 2007 5:50 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
WHAT design constraints, please?
Yes, you should be able to use the MQ APIs from a Java Compute node. You will need to exercise some caution, though, about connection handles and etc, to ensure that you do not inadvertently interrupt the transactional handling of the Broker flow itself. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bijesh |
Posted: Wed Feb 28, 2007 5:56 am Post subject: |
|
|
Acolyte
Joined: 30 Jan 2007 Posts: 66
|
WHAT design constraints, please?
I need to look at the current depth of another queue.
if the current depth is less than a particular count then only i'l hv to get the message from the queue. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 28, 2007 6:06 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
That's horrible.
Please don't design that way. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bijesh |
Posted: Wed Feb 28, 2007 6:23 am Post subject: |
|
|
Acolyte
Joined: 30 Jan 2007 Posts: 66
|
jefflowrey wrote: |
That's horrible.
Please don't design that way. |
How else can i go ahead.? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Feb 28, 2007 6:41 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It sounds like you're trying to implement some kind of weird broker based Trigger on Queue Depth.
I really can't suggest a better course without knowing the real problem you're actually trying to solve - but I will say that when working with Broker you should always design to process messages immediately as they come in, and always process a queue until it's empty. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 28, 2007 11:52 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bijesh wrote: |
I need to look at the current depth of another queue.
if the current depth is less than a particular count then only i'l hv to get the message from the queue. |
That's just bizzare. Like a Depth trigger in reverse. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|