On 24 July 2012 17:46, Spandit2 <spand...@csc.com> wrote:
> Hello All  ,
>
> I am using CXF DOSGI and ZooKeeper . I have some REST services which I can
> see being registered in service registry .
>
> I have a client application which is plain Java application implemented
> using ZooKeeper API .
>
> My question is how do I get all the details about End Point ?
>
> When I search the node in ZooKeeper , I get the node and it has one child of
> type String . The value of this is something like this
> 192.168.1.2#8090##appentry#rqastartflow
>
> I need to read all the other details about the service which are bound as
> part of endpoint description . How can I read those ?
>
> Thanks
> Sunil

Hi Sunil,

The information is stored in the zookeeper entry in XML, using the
endpoint-description schema defined in the OSGi Remote Service Admin
specification [1] section 122.8. The entries are stored in
/osgi/service_registry/<fully-qualified-interface-name>/hostname#port##service-id

Just an example of what it looks like, by using the zkCli.sh program:

[zk: 127.0.0.1:21810(CONNECTED) 29] ls
/osgi/service_registry/org/coderthoughts/cloud/demo/api/TestService
[osgi11-coderthoughts.rhcloud.com#80##63]
[zk: 127.0.0.1:21810(CONNECTED) 30] get
/osgi/service_registry/org/coderthoughts/cloud/demo/api/TestService/osgi11-coderthoughts.rhcloud.com#80##63
<?xml version="1.0" encoding="UTF-8"?>
<endpoint-descriptions xmlns="http://www.osgi.org/xmlns/rsa/v1.0.0";>
  <endpoint-description>
    <property name="org.apache.cxf.ws.httpservice.context" value="/63" />
    <property name="endpoint.service.id" value-type="Long" value="63" />
    <property name="service.imported.configs">
      <array>
        <value>org.apache.cxf.ws</value>
      </array>
    </property>
    <property name="service.intents">
      <array>
        <value>SOAP.1_1</value>
        <value>HTTP</value>
        <value>SOAP</value>
      </array>
    </property>
    <property name="objectClass">
      <array>
        <value>org.coderthoughts.cloud.demo.api.TestService</value>
      </array>
    </property>
    <property name="endpoint.framework.uuid"
value="d0ed6851-bad5-0011-1d8a-cd2e802a457a" />
    <property name="service.imported" value="true" />
    <property name="endpoint.id"
value="http://osgi11-coderthoughts.rhcloud.com:80/63"; />
    <property name="org.apache.cxf.ws.address"
value="http://osgi11-coderthoughts.rhcloud.com:80/63"; />
    <property name="endpoint.package.version.org.coderthoughts.cloud.demo.api"
value="1.0.0.SNAPSHOT" />
  </endpoint-description>
</endpoint-descriptions>

The above is not a REST service, but an entry for that should be
similar I think.

Hope this helps,

David

[1] http://www.osgi.org/Download/Release5

Reply via email to