|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
create a MbMessage from scratch |
« View previous topic :: View next topic » |
Author |
Message
|
goffinf |
Posted: Thu Dec 04, 2008 8:19 am Post subject: create a MbMessage from scratch |
|
|
Chevalier
Joined: 05 Nov 2005 Posts: 401
|
Looks like I spoke too soon in my previously post
I want to construct an MBMessage from scratch AND (this may be the critical point) I want to do it in the constructor of a custom node (when the Broker loads a flow which contains that node) rather than the evaluate method.
I had seen this in the Information Centre :-
Quote: |
Many message transformation scenarios require a new outgoing message to be built. The Create Message Class template in the JavaCompute node wizard generates template code for this.
In the template code, the default constructor of MbMessage is called to create a blank message, as shown in the following Java code:
MbMessage outMessage = new MbMessage(); |
.. and when I tried in a JCN (evaluate) it worked fine. BUT, it doesn't work in a constructor of a custom node, that is, it throws an MbExecption and crashes the execution group !
The context of the question is that I am calling the IA91 CacheNode putIntoCache method from the contructor (to pre-load the cache) and it expects 2 MBElement arguments (which I can create once I get an MbMessage).
Is there any way to make this work where I need it ???
Failing that, I wonder whether anyone knows if I can call another method on the IA91 classes that don't require MbElement args. I am currently using :-
putIntoCache(String, MbElement, MbElement, Long, Boolean)
from the ESQL class, the first arg is the cache name, the next 2 are refs to the cache item name and value, next is the expiry value and lastly whether the cache is broker wide.
However I note that there is a Cache class which has this method, but I'm not sure what I can pass as args and I'm not entirely sure what they are ? :-
put(String, Object, Object, long)
Many thanks
Fraser. |
|
Back to top |
|
 |
goffinf |
Posted: Thu Dec 04, 2008 1:56 pm Post subject: |
|
|
Chevalier
Joined: 05 Nov 2005 Posts: 401
|
I (think) I have resolved the problem with needing MbElement types to pass to IA91. The answer is, you can just use String for both args if you use the Cache.Cache class put method (see my related IA91 from Java post).
So the desparate need to answer the first part of this post has (I hope) gone away. I suspect it isn't possible, but if anyone cares to agree or refute that I be delighted to hear.
Regards
Fraser. |
|
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
|
|
|
|