![]() |
The lightweight and speedy integration framework. |
![]() |
|
Example:
Here are all the methods you need to implement in order to create a base adapter
Obviously this does nothing to interact with anything, but we do get our failover capability. If you start another instance of this adapter on another machine (or on this one for that matter), the first one started will be in control and its init and startup methods will be called. The second instance will have not have the init and start called until the first instance shuts down or dies an untimely death. So here is a little more concrete stuff. This adapter is a simple adapter that accepts input from the console and publishes the string on a channel and subject that is defined in the config file. This adapter also subscribes to subjects defined in the config file. We just happen to subscribe to what we are publishing. Run this adapter on another machine and change the failover.channel in the config file to a unique name and you will see the messages comming through from one adapter to the other.
Pretty simple. To run it all you need to do is type java -Dconfig.file=consoleAdapter.xml net.sourceforge.ipony.examples.ConsoleAdapterSo here is the config file we used <properties> <category name="attributes"> <property name="pubSubject" value="test.subject"></property> <property name="pubChannel" value="MyChannel"></property> </category> <category name="subscription.1"> <property name="subject" value="test.>"></property> <property name="channel" value="MyChannel"></property> </category> <category name="db.persistance"> <property name="user" value="sa"></property> <property name="password" value=""></property> <property name="url" value="jdbc:hsqldb:test"></property> <property name="driver" value="org.hsqldb.jdbcDriver"></property> <property name="DatabaseName" value="adapter"></property> </category> <category name="general"> <property name="recovery.channel" value="testrecoverychannel"></property> <property name="peristance.factory" value="net.sourceforge.ipony.message.persistance.db.DbMessagePersistanceFactory"></property> <property name="failover.channel" value="failover"></property> <property name="jmx.port" value="8080"></property> <property name="class.name" value="net.sourceforge.ipony.examples.ConsoleAdapter"></property> </category> </properties> More to come..... |
|