ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Send Exit Question - c-based exit invoked by Java client

Post new topic  Reply to topic
 Send Exit Question - c-based exit invoked by Java client « View previous topic :: View next topic » 
Author Message
Amyb19
PostPosted: Fri Sep 08, 2006 1:58 pm    Post subject: Send Exit Question - c-based exit invoked by Java client Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Fri Sep 08, 2006 2:50 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/csq77chex.htm wrote:
You cannot change the size of the agentBuffer in an exit.


But I'm not sure if that's what you're asking.

You might also look at the section on "Using channel exits not written in Java" on that same link...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Send Exit Question - c-based exit invoked by Java client
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.