11
Using CORBA To Bridge C++ Using CORBA To Bridge C++ and JMS and JMS Niall Stapley, CERN email: [email protected] http://stapley.web.cern.ch/stapley/ CORBAtoJMS/doc/

Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

Embed Size (px)

DESCRIPTION

3 Alarms Part of CERN SL/CO. Gather, analyze, distribute fault states. Sources from any part of CERN: –heterogeneous platforms: Servers PCs VME computers – and languages: C, C++ Java

Citation preview

Page 1: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

Using CORBA To Bridge C++ and Using CORBA To Bridge C++ and JMSJMS

Niall Stapley, CERN

email: [email protected]://stapley.web.cern.ch/stapley/CORBAtoJMS/doc/

Page 2: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

2

OverviewOverview

• Alarms• Message Oriented Middleware• Architecture• MessageStruct• Bridge Description• The C++ client• Current Status

Page 3: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

3

AlarmsAlarms• Part of CERN SL/CO.• Gather, analyze, distribute

fault states.• Sources from any part of

CERN:– heterogeneous platforms:

• Servers• PCs• VME computers

– and languages:• C, C++• Java

CPU

Alarm System

Page 4: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

4

Message Oriented MiddlewareMessage Oriented Middleware

• What is it?– Queue-based asynchronous message exchange– Provides reliability, flexibility, portability– Allows many-to-many communication

• Good for event-driven communication• Java Message Service is the Java standard

– Includes publish and subscribe• CMW project defined a MOM API

– which simplifies JMS– but only implemented in Java

Page 5: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

5

ArchitectureArchitecture

Non-Java Node

Java Server Node

1

0..*

CORBA IIOP

JMS CORBA Bridge JMSSubscribeAdapter

C++ ClientSubscribeListener

PublishAdapterJMS Broker

Java Node

Java Client

1

0..*

TCP/IP

Page 6: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

6

MessageStructMessageStructunion BodyFormatUnion switch (BodyFormatEnum) {

case BYTES_FORMAT: OctetSeq octetSeqV;

case TEXT_FORMAT: string stringV;

case MAP_FORMAT: MapSeq mapSeqV;

case STREAM_FORMAT: DataTypeUnionSeq dataTypeUnionSeqV;

case ANY_FORMAT: any anyV;

};

struct MessageStruct {

HeaderSeq headers;

PropertySeq properties;

BodyFormatUnion body;

};

Page 7: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

7

Bridge DescriptionBridge DescriptionServer PublishAdapterServant

CORBAToJMSConverter

CORBA

1

1

1 1

«interface»MOMPublisher

SubscribeAdapterServant

JMSToCORBAConverter

SubscriptionsManager

SubscriptionListenerAdapterSubscriptionListener

SubscriptionListener

1 11*

1*

«interface»MOMSubscriber

Page 8: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

8

Publish ExamplePublish Example#include <include_the_world.h>using namespace everything;int main (int argc, char* argv[]) {

Publisher &the_publisher = Publisher::init( argc, argv ); TextMessage message(); message.setStringProperty( "the_name", "the_value" ); message << "This is inserted into the body"; the_publisher.publish( "CERN.TEST", message ); return (EXIT_SUCCESS);

} // main

Page 9: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

9

Subscribe ExampleSubscribe Example#include <include_the_world.h>using namespace everything;void messageHandler (Message &message);

int main (int argc, char* argv[]) { Subscriber &the_subscriber = Subscriber::init( argc, argv ); long long handle = the_subscriber.subscribe( jms_topic, "", messageHandler ); // do other stuff the_subscriber.unsubscribe( handle ) return (EXIT_SUCCESS);} //main

Page 10: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

10

Current StatusCurrent Status

• Provides Publish / Subscribe MOM API as shown.• Uses JacORB and Orbix/E• Potential attention areas

– Increase security• The long descriptor.• Add user / password protection.

– Add JMS Message Headers.– Dynamic Object/IDL conversion handler.– extern ‘C’ client library

• Start testing it with alarms

Page 11: Using CORBA To Bridge C++ and JMS Niall Stapley, CERN

11

And Finally...And Finally...

• Thanks for your attention!

• Any questions?