Author |
Message
|
ashu |
Posted: Sun May 13, 2007 11:48 pm Post subject: About Channel Exits |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
Hello,
I'm reading channel exits from the 'intercommunication' but some how i'am unable to grasp the 'Writing and Compiling' section of the Channel Exits chapter in the book.
I think might be if I see the actual code I might be able to infer something from it.
Can any one provide me with a pointer to some Java code for channel exits?
Thanks in advance.
Regards, _________________ Ashu
"It is simple to be Happy but difficult to be Simple" |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon May 14, 2007 12:00 am Post subject: Re: About Channel Exits |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
ashu wrote: |
Hello,
I'm reading channel exits from the 'intercommunication' but some how i'am unable to grasp the 'Writing and Compiling' section of the Channel Exits chapter in the book.
I think might be if I see the actual code I might be able to infer something from it.
Can any one provide me with a pointer to some Java code for channel exits?
Thanks in advance.
Regards, |
Server side exits you can write only with C.
I mean exits installed on MQ server machine which are referenced in channel attributes.
With JAVA you can write MQSendExit MQReceiveExit and MQSecurityExit (client side). Their interfaces are MQSendExit, MQReceiveExit, MQSecurityExit
Saying "client side" I mean your application where you connect to MQ with channel exit installed and you have to write code which lets you communicate with installed exits.
In your app you have to implement exit interface and place it in MQEnvironment dedicated fields.
Code: |
MyMQExits myexits = new MyMQExits(); //your code
MQEnvironment.securityExit = myexits;
MQEnvironment.sendExit = myexits;
MQEnvironment.receiveExit = myexits; |
_________________ Marcin |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon May 14, 2007 12:06 am Post subject: Re: About Channel Exits |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
You can find little example in "Using JAVA" doc. _________________ Marcin |
|
Back to top |
|
 |
ashu |
Posted: Mon May 14, 2007 12:23 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
Hello Marcin,
Thank you for replying so promptly.
I have a little doubt, which I hope you might spend time to clarify...
Quote: |
Saying "client side" I mean your application where you connect to MQ with channel exit installed and you have to write code which lets you communicate with installed exits. |
Code: |
MyMQExits myexits = new MyMQExits(); //your code
MQEnvironment.securityExit = myexits;
MQEnvironment.sendExit = myexits;
MQEnvironment.receiveExit = myexits; |
Is myexit the code that connects to a exit written in C and installed on the server OR is it the actual logic of the exit?
[ my java appln might be on the server machine or some remote machine connecting via MQClient --does that cause any difference?]
Apologies for my innocence...
Regards, _________________ Ashu
"It is simple to be Happy but difficult to be Simple" |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon May 14, 2007 12:41 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
ashu wrote: |
Is myexit the code that connects to a exit written in C and installed on the server OR is it the actual logic of the exit?
[ my java appln might be on the server machine or some remote machine connecting via MQClient --does that cause any difference?]
Apologies for my innocence...
Regards, |
It doesn't matter where your app is running. It has to be client connection. Thats all.
Lets imagine you have security exit installed on MQ server machine which lets you connect after passing security key.
In this situation in your JAVA app you have to pass this key.
You have to write class which implement interface above and say API to use this exit during communication.
template code (from "Using JAVA")
Code: |
class MyMQExits implements MQSendExit, MQReceiveExit, MQSecurityExit {
// This method comes from the send exit
public byte[] sendExit(MQChannelExit channelExitParms,
MQChannelDefinition channelDefParms,
byte agentBuffer[])
{
// fill in the body of the send exit here
}
// This method comes from the receive exit
public byte[] receiveExit(MQChannelExit channelExitParms,
MQChannelDefinition channelDefParms,
byte agentBuffer[])
{
// fill in the body of the receive exit here
}
// This method comes from the security exit
public byte[] securityExit(MQChannelExit channelExitParms,
MQChannelDefinition channelDefParms,
byte agentBuffer[])
{
// fill in the body of the security exit here
}
} |
_________________ Marcin |
|
Back to top |
|
 |
ashu |
Posted: Mon May 14, 2007 12:50 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
Many thanks for the clarification...!
Warm Regards, _________________ Ashu
"It is simple to be Happy but difficult to be Simple" |
|
Back to top |
|
 |
ashu |
Posted: Mon May 14, 2007 1:27 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
Hello again,
Is the statement, "Channel Exits and Data conversion exits are two types of user exits" valid??
Regards, _________________ Ashu
"It is simple to be Happy but difficult to be Simple" |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon May 14, 2007 1:33 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
ashu wrote: |
Hello again,
Is the statement, "Channel Exits and Data conversion exits are two types of user exits" valid??
Regards, |
Channel Exits is general name.
Channel Exits can be security exit which lets you secure your MQ environment.
Channel Exits can be data conversion exit (message, send , receive, ...) which lets you manipulate message structure. _________________ Marcin |
|
Back to top |
|
 |
ashu |
Posted: Mon May 14, 2007 2:17 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
marcin.kasinski wrote: |
ashu wrote: |
Hello again,
Is the statement, "Channel Exits and Data conversion exits are two types of user exits" valid??
Regards, |
Channel Exits is general name.
Channel Exits can be security exit which lets you secure your MQ environment.
Channel Exits can be data conversion exit (message, send , receive, ...) which lets you manipulate message structure. |
Why is that you have to configure the data conversion exit with the Qmgr while channel exits have to configure with the Channel ...(I read it in two different books 'App Prog Guide'(data conversion) and 'Intercommunication'(Channel exit))
Sorry for being so confusing...
Regards, _________________ Ashu
"It is simple to be Happy but difficult to be Simple" |
|
Back to top |
|
 |
Vitor |
Posted: Mon May 14, 2007 2:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ashu wrote: |
Why is that you have to configure the data conversion exit with the Qmgr while channel exits have to configure with the Channel ...(I read it in two different books 'App Prog Guide'(data conversion) and 'Intercommunication'(Channel exit))
|
Because some exits are part of the queue manager, others are part of the channel agent.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
ashu |
Posted: Mon May 14, 2007 2:28 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
So gist is that all the exits are loosely called Channel exits...
Is it the case that when we write user exits we are actually overriding(in OOP terms) the functionality of the existing exits of that type?
Regards, _________________ Ashu
"It is simple to be Happy but difficult to be Simple" |
|
Back to top |
|
 |
ashu |
Posted: Mon May 14, 2007 2:39 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
Quote: |
Channel Exits can be data conversion exit (message, send , receive, ...) which lets you manipulate message structure. |
[NOTE: I don't expect an answer for this post...But if somebody can enlighten me then I would be thankful]
on second thought....
I can understand that security / message exits tell something about how the channel behaves...like whether the channel is being established between to valid parties...or can the channel support large messages else the message needs to be chopped...and so on...
But the data conversion exits have nothing to do with the channel's behaviour...so why is it a channel exit?
I already feel dumb...so you can express that freely
Regards, _________________ Ashu
"It is simple to be Happy but difficult to be Simple" |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Mon May 14, 2007 2:46 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
ashu wrote: |
But the data conversion exits have nothing to do with the channel's behaviour...so why is it a channel exit?
|
Not exactly.
This is place where you can modify messages outside sending or receiving application.
It is just after putting message to remote queue or on second hand just after placing message into destination queue. _________________ Marcin |
|
Back to top |
|
 |
Vitor |
Posted: Mon May 14, 2007 2:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ashu wrote: |
But the data conversion exits have nothing to do with the channel's behaviour...so why is it a channel exit? |
Aside from the behaviour exhibited by the channel when it's CONVERT attribute is YES perhaps.....
ashu wrote: |
I already feel dumb...so you can express that freely
|
I would have described you as "inadequately researched"
Read and experiment in a methodical manner. You'll climb the learning curve in no time. Remember none of us were born understanding MQ. (With one possible exception.... )
Do not despare and remember that the search function is your friend. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
ashu |
Posted: Mon May 14, 2007 2:58 am Post subject: |
|
|
 Centurion
Joined: 11 Nov 2006 Posts: 132
|
I'am reading whatever I get my hands on regarding exits. I have also implemented the mirrorq example...but some how none of the texts tell me the exact definition of what an exit is...only that it is implicitly called (if configured ) where ever required...
but issues like,
Quote: |
Is it the case that when we write user exits we are actually overriding(in OOP terms) the functionality of the existing exits of that type? |
OR how to start writing an exit...have not been explained anywhere....atleast I did not find it...so
Quote: |
I would have described you as "inadequately researched" |
is acceptable to me..
Thank you all for your participation
Regards, _________________ Ashu
"It is simple to be Happy but difficult to be Simple" |
|
Back to top |
|
 |
|