Skip to main content Skip to complementary content

Service deployment

Before you begin

  • If you installed ZooKeeper in standalone mode, 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.

Once all the bundles are installed, the environment is ready to test. Note that locator_client needs to stay stopped for the time being.

About this task

Once the Service Locator has been installed successfully in the Talend Runtime Container, you can deploy the services.

Procedure

  1. After executing bundle:start 157:
    • If you installed ZooKeeper in standalone mode, 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 to list all the installed and started bundles. To check that the services are working, go to http://localhost:8040/services/.

  2. 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.
  3. 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
  4. For more test, execute bundle:stop 158 and bundle:start 158 on the 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.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!