Before you begin
-
If you installed Zookeeper in standalone, you first need to
install and start two bundles: "org.talend.esb.locator" and
"org.apache.zookeeper.zookeeper" that activate the Service Locator feature in the Talend Runtime Container. And
then, you can deploy the three bundles you previously created and
start them. To do so, execute the following commands
sequentially:
karaf@trun> bundle:install mvn:org.apache.zookeeper/zookeeper/3.3.3
karaf@trun> bundle:install mvn:org.talend.esb/locator/
karaf@trun> bundle:install mvn:org.talend.esb.examples.locator/locator_common/1.0.0
karaf@trun> bundle:install mvn:org.talend.esb.examples.locator/locator_service/1.0.0
karaf@trun> bundle:install mvn:org.talend.esb.examples.locator/locator_client/1.0.0
karaf@trun> bundle:start 154
karaf@trun> bundle:start 155
karaf@trun> bundle:start 156
karaf@trun> bundle:start 157
-
If you installed Zookeeper as an OSGi bundle, you will only need
to deploy the three bundles you previously created and start
them:
karaf@trun> bundle:install mvn:org.talend.esb.examples.locator/locator_common/1.0.0
karaf@trun> bundle:install mvn:org.talend.esb.examples.locator/locator_service/1.0.0
karaf@trun> bundle:install mvn:org.talend.esb.examples.locator/locator_client/1.0.0
karaf@trun> bundle:start 156
karaf@trun> bundle:start 157
The bundle numbers returned for each bundle:install
command
will probably be different from those used in this sample; use those numbers
instead.
Then, all bundles will be installed and the environment is ready to test.
Except "locator_client", we need to keep it stopped for the time
being.
About this task
Now that the Service Locator has
been installed successfully in the Talend Runtime Container, you will deploy the
services.
Procedure
-
After executing
bundle:start 157
:
-
If you installed Zookeeper in standalone, change to the ZooKeeper
console, and you will see some log messages
like:2011-06-02 16:17:02,031 - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn$Factory@251] -
Accepted socket connection from /127.0.0.1:1102
2011-06-02 16:17:02,031 - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@777] - Client
attempting to establish new session at /127.0.0.1:1102
2011-06-02 16:17:02,046 - INFO
[SyncThread:0:NIOServerCnxn@1580] - Established session 0x1304f61dba10001
with negotiated timeout 5000 for client /127.0.0.1:1102
-
If you installed Zookeeper as an OSGi bundle, execute the console
command list
and all the installed and started bundles
should be listed and to check that the services are working, go to:
http://localhost:8040/services/.
-
After installation has been done either in standalone or as an OSGi bundle
and the service started and working, execute
bundle:start 158
on
the Container console, you should get some output message in the
console:
karaf@trun> bundle:start 158
Executing operation greetMe
Message received: MyName
Hello MyName
If you get a message like this, then you did the right thing.
-
Turn to zooKeeper console (if you are using it as standalone), you can see
the connection message like below:
2011-06-02 16:24:19,671 - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn$Factory@251] -
Accepted socket connection from /127.0.0.1:1126
2011-06-02 16:24:19,671 - INFO
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@777] - Client
attempting to establish new session at /127.0.0.1:1126
2011-06-02 16:24:19,703 - INFO
[SyncThread:0:NIOServerCnxn@1580] - Established session 0x1304f61dba10002
with negotiated timeout 5000 for client /127.0.0.1:1126
-
For more test, execute
bundle:stop 158
and the bundle:start
158
on OSGi Container console, you will have the same result as
described above.
So far, you saw how to use Service Locator. In the next section, you will look into Service Activity Monitoring.