|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ Send Exit Question - c-based exit invoked by java client |
« View previous topic :: View next topic » |
Author |
Message
|
Amyb19 |
Posted: Fri Sep 08, 2006 2:02 pm Post subject: MQ Send Exit Question - c-based exit invoked by java client |
|
|
Newbie
Joined: 08 Sep 2006 Posts: 3
|
Hi All,
I am trying to write a client-side send exit in c, which will be invoked from both Java and c clients.
My MQ Client is v6.0, and the Java clients will use the new MQQueueManager constructor which takes the URL of a channel definition table as a parameter.
I can get my send and receive exits to load when invoked from the Java client, but I need to add some data to the buffer being sent across to the server receive buffer. I haven't been able to figure out how to make this work.
As I understand it, when the exit is invoked from a c-based client, I am passed an AgentBuffer of a given size (pAgentBuffLen). An additional parameter, pDataLen, tells me how much of this buffer is already used. As long as pDataLen is less than pAgentBufferLen, I can pad the data in pAgentBuff up a length of pAgentBufferLen. The pDataLen field gets set to it's new value, and I return. This sends the padded buffer to the server side.
If I require more space than available by this method, I can malloc a new buffer and copy the original AgentBuffer plus my additional data into the new buffer. The address of the new buffer gets placed in the pExitBufferAddr field. pExitBufferAddr is a pointer to the address of a buffer of storage managed by the exit. I then set pParms->ExitResponse2 to MQXR2_USE_EXIT_BUFFER. This causes my new buffer to be sent to the server side instead of the original buffer.
This all works fine in my client exit when invoked from c. However, when invoked from Java, things change. The pDataLen field appears to always be set to exactly the pAgentBuffLen field, so I can't pad the existing pAgentBuff field. And pExitBufferAddr itself is uninitialized, so I can't use it to store the location of the new buffer. From what information I've been able to find on this, I don't believe it's valid to use pExitBufferAddr when your exit gets invoked by a java client.
So, after all that long-winded set-up, my question is, how can I append additional data within my send exit (in my case around 512 bytes are needed) to the buffer being transmitted from my client to the server, in the situation where my send exit gets invoked from a java-based client application?
Any thoughts, suggestions, or advice would be greatly appreciated. Thanks.
-Amy |
|
Back to top |
|
 |
JasonE |
Posted: Sat Sep 09, 2006 1:10 pm Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Does this apar help? You'll need to get it from IBM service, but read the description first to see if you think it matches
http://www-1.ibm.com/support/docview.wss?uid=swg1IC49717
(The description I saw about it, was something like... The fix corrects how the buffers are presented to the client, to make the Java client mimick the C client closer. The ExitBuffer is maintained across calls to the exit, and the AgentBuffer is allocated to a minimum size of 3968 bytes, as per the C client. ) |
|
Back to top |
|
 |
Amyb19 |
Posted: Sat Sep 09, 2006 10:38 pm Post subject: |
|
|
Newbie
Joined: 08 Sep 2006 Posts: 3
|
Thanks JasonE! I'll try that fixpack. It sounds like it might be what I need.
-Amy |
|
Back to top |
|
 |
JasonE |
Posted: Mon Sep 11, 2006 12:31 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
You'll have a long wait (6.0.2.0 it isnt out yet, let alone 6.0.2.1)... If that fix is what you need you'll need to get it from IBM service, quoting the apar no |
|
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
|
|
|
|