HI,
I've to integrate the callability of SMX4 from a mainframe.
This means that I have to run a server inside SMX which is callable from the
mainframe
The process would be:
1) Some ESB component (which I have to provide) starts the server process
(which connects itself to a middleware).
2) Then the server process is callable from the mainframe and has a defined
entry point where the ESB stuff can be executed
3) When the mainframe calls the ESB I would like to call a servicemix-bean
in a synchronous way and pass the result back to the mainframe
I would want a really SIMPLE solution. Is it possible to define the
following peace of code in a simple bean? When I receive a host call, I
would want create a SMX MessageExchange which calls the corresponding
servicemix-bean (sync). Than I could pass the result of the service back to
the mainframe.
I already tried to start the server in an usual servicemix-bean but the SMX
behaviour was strange (when I deployed the SA after SMX start the simple
bean approach worked -> when I had the SA already deployed when SMX starts
the SMX startup hangs)
Maybe to make it a little bit more transparent -> here is a sample code
fragement I have to execute as server process in SMX
In the (xml) string (sServiceRequest) I receive the information which I
need to know to call the corresponding service in SMX.
Code fragment for receiving mainframe calls:
Broker broker = new Broker(brokerID, "JavaServer");
BrokerService bService = new BrokerService(broker, serverAddr);
// Declare one Message object to capture an incoming message and to
// hold the reply
BrokerMessage bMessage;
try {
bService.register();
// listen for new connections
boolean loop = true;
while (loop) {
try {
bMessage = bService.receive();
// here an xml Service request comes in from mainframe
String sServiceRequest = new
String(bMessage.getMessage());
// Perform some logic in the ESB world (message
exchange in a synchronous way, and so on)
// String resultOfEsbLogic= ....
bMessage.setMessage(resultOfEsbLogic);
bMessage.reply(new BrokerMessage(msg));
} catch (BrokerException bE) {
..
}
}
}
// deregister and logoff
bService.deregister();
broker.logoff();
broker.disconnect();
} catch (BrokerException bE) {
...
}
I did a post already
(http://cwiki.apache.org/SM/discussion-forums.html#nabble-td21584515|a21584515)
but I'm really in doubt what I have to do
TIA,
Martin
--
View this message in context:
http://www.nabble.com/Running-a-Server-inside-SMX4-%28mainframe-connection-server%29-tp21788302p21788302.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.