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 Java / JMS » Channel send exit

Post new topic  Reply to topic
 Channel send exit « View previous topic :: View next topic » 
Author Message
akinomd
PostPosted: Mon Feb 24, 2003 5:53 am    Post subject: Channel send exit Reply with quote

Newbie

Joined: 24 Feb 2003
Posts: 2

I would like to write a send exit in Java.
I defined a class (MySendExit) that implements the MQSendExit interface. Then in the other class (MyTest) I created a new instance of the class MySendExit, assigned the MQEnvironment.sendExit variable to it and constructed my MQQueueManager object...
Both classes I have in the same directory, which I included in my classpath.
The problem is that I do not know how to set the SENDEXIT and SENDDATA parameters in the channel. I tried to specify the channel send exit name as "java my.package.MyTest", but it unfortunately does not work... No matter how I configure that parameter, my channel does not want to start and its status is continuously 'retrying'. Could anyone help me?

Thanks for any replies,
akinomd
Back to top
View user's profile Send private message
emiranda
PostPosted: Fri Mar 14, 2003 11:30 am    Post subject: Reply with quote

Disciple

Joined: 21 Nov 2002
Posts: 196
Location: Dublin, Ireland

Hi.

Java is only supported in client side. Otherwise you have to use C/C++.

rgds,
_________________
Warm Regards,
EM
Back to top
View user's profile Send private message
akinomd
PostPosted: Wed Mar 19, 2003 12:03 am    Post subject: Reply with quote

Newbie

Joined: 24 Feb 2003
Posts: 2

Hi Eduardo,

Thanks for the reply. I have already found out that I can only write client code in Java. Anyway, I would be very grateful to you for any information on setting the SENDEXIT parameter in the channel (for Java programs). If you could help me, let me know, please.

Regards,
akinomd
Back to top
View user's profile Send private message
rajmq
PostPosted: Sat Mar 29, 2003 11:01 pm    Post subject: Reply with quote

Partisan

Joined: 29 Sep 2002
Posts: 331
Location: USA

Hi emiranda

Can u explain How can i achive Client to Server Channel Exits Using the
Java.
can u give some links or sample programs.

thanks
raj
Back to top
View user's profile Send private message
emiranda
PostPosted: Mon Mar 31, 2003 5:18 am    Post subject: Reply with quote

Disciple

Joined: 21 Nov 2002
Posts: 196
Location: Dublin, Ireland

Hi guys,
Unfortunately I don't have any sample exit in Java code written by myself, but I got something in my files (probably another discussion/newsgroup).

You have to implement the interfaces MQSecurityExit, MQSendExit and MQReceiveExit.
The pseudocode for Java exits:

MyExit.java
------------

public MyExit implements
MQSecurityExit, MQSendExit, MQReceiveExit {

public byte[] securityExit ( .... ) {
// Implement function here.
}
public byte[] sendExit ( .... ) {
// Implement function here.
}
public byte[] receiveExit ( .... ) {
// Implement function here.
}
}

Client.java
------------

public class Client {
public static void main (String args[])
{
MQEnvironment.securityExit =
MQEnvironment.sendExit =
MQEnvironment.receiveExit = new MyExit();

// Create QMGR connection here etc...
}
}

Here all the interfaces are implemented in only one class. You can implement them in different classes files also.

Hope it helps
rgds,
_________________
Warm Regards,
EM
Back to top
View user's profile Send private message
rajmq
PostPosted: Tue Apr 01, 2003 9:57 pm    Post subject: Reply with quote

Partisan

Joined: 29 Sep 2002
Posts: 331
Location: USA

Hi emiranda

Thanks for ur Reply.

public byte[] sendExit ( .... ) {
// Implement function here.
}

But the problem is what function implementation i need write,can u give any example or that discussion link...

regards
raj
Back to top
View user's profile Send private message
Torsten
PostPosted: Thu Jul 20, 2006 7:21 am    Post subject: MQSendExit samples Reply with quote

Newbie

Joined: 20 Jul 2006
Posts: 7
Location: Denmark

Hi

I've a problem in locating my user msg in the byte[] parameter to the SendExit method.

I've found (by experiments) that my SendExit method is invoked 5 or 6 times upon a put to a queue (!!), but only one of the invokations contains my user msg - starting at location 512 (or something like that).

I've also found that the 4 bytes before pos 512, contains the length of my user msg.

So far so good, but this is a kind of "hacking" and I've searched the net in vain (inclunding IBM's MQ docs) for specification of the byte[] layout.

The only thing, I've found is some C structs - but that does'nt help very much.

Anyone with experience in this ??
Take care
Torsten
Back to top
View user's profile Send private message
Nigelg
PostPosted: Mon Jul 24, 2006 1:13 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

The layout of the data in the channel flows is not published by IBM, so you have to hack it, as you put it, if you want to find your data.
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jul 24, 2006 1:19 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Also, if you want the whole message, you can use a message exit instead of a send/receive exit.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Torsten
PostPosted: Mon Jul 24, 2006 1:23 am    Post subject: Reply with quote

Newbie

Joined: 20 Jul 2006
Posts: 7
Location: Denmark

Hi

thanks both for your replies, but a message exit can't be written in Java ???

Take care
Torsten
Back to top
View user's profile Send private message
Nigelg
PostPosted: Mon Jul 24, 2006 1:29 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

In that case write the exit in a programming language that is supported, i.e. C.
_________________
MQSeries.net helps those who help themselves..
Back to top
View user's profile Send private message
markt
PostPosted: Mon Jul 24, 2006 6:01 am    Post subject: Reply with quote

Knight

Joined: 14 May 2002
Posts: 508

A channel exit written in Java can only be used in Java programs.
The only Java MQ programs are clients (or locally bound).
The only channel exits for any client are security and send/receive.

Therefore you cannot write a channel message exit in Java.

The contents of the send/receive buffers are not externally documented, other than byte 10 which tells you which MQI verb is being executed.

You cannot rely on the layout of the send/receive buffer - it can and will
change. And if the channel has compression enabled, that happens above
the send/receive exits so you would not see plaintext anyway.
Back to top
View user's profile Send private message
Torsten
PostPosted: Mon Jul 24, 2006 6:10 am    Post subject: Reply with quote

Newbie

Joined: 20 Jul 2006
Posts: 7
Location: Denmark

thank you markt

we are using jms and core mq API for Java, so the MQSendExit and MQReceiveExit seemed to be logical choices.

Your remark about compression worries me, because we are later going to use 2-way SSL - so then I won't get plain text either ??? (in exits).

If that's the case, I might just provide the MDB developers with a POJO, capable of making the required data modifications required during test-phases.

They can then invoke my POJO just prior to sending and just after receiving MQ messagers

thanks to all
Torsten
Back to top
View user's profile Send private message
markt
PostPosted: Mon Jul 24, 2006 6:40 am    Post subject: Reply with quote

Knight

Joined: 14 May 2002
Posts: 508

encryption in SSL happens AFTER the send exit so a send exit would see
compressed, but not encrypted headers and data, assuming you turn on both SSL and compression.
Back to top
View user's profile Send private message
Torsten
PostPosted: Tue Jul 25, 2006 12:30 am    Post subject: Reply with quote

Newbie

Joined: 20 Jul 2006
Posts: 7
Location: Denmark

Hi markt

OK, since we not are going to use compression, I'll continue to use the exits.

Thanks for the help
Torsten
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 Java / JMS » Channel send exit
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.