jUDDI—JBoss ESB's default registry

jUDDI is the Apache open source reference implementation (written in Java) for the UDDI specification. Some of the defining characeristics of jUDDI are:

  • Standards based: jUDDI supports the UDDI version 3.0 specification. Scout implements the Java API for XML Registries (JAXR). We'll review using Scout to inquire and publish services lter on in this chapter.
  • Platform independent: jUDDI is written in Java, so any place that you can run a JVM, you can run jUDDI.
  • Support for multiple databases for persistence: The service definitions that you use are stored in a persistent database by jUDDI. jUDDI supports most major databases such as MySQL, PostgreSQL, Oracle, and others.
  • Configurable: jUDDI can be configured in clusters for added reliability and performance, and can be integrated with authentication systems such as LDAP, or JAAS compliant systems. jUDDI also supports multiple transport protocols.

Configuring jUDDI for different protocols

As packaged with JBoss ESB, jUDDI is configured to use the "local" transport. Briefly, this configuration assumes (well, requires, actually) that the jUDDI server and JBoss ESB server share the same virtual machine. jUDDI also supports the RMI and SOAP protocols for configuring a server. To change the configuration, use esb.juddi.client. xml found at jboss-as/server/default/deploy/jbossesb.sar/.

The relevant configuration lines look something like this:

<proxyTransport>
  org.jboss.internal.soa.esb.registry.client.JuddiInVMTransport
</proxyTransport>
<custodyTransferUrl>
  org.apache.juddi.api.impl.UDDICustodyTransferImpl
</custodyTransferUrl>
<inquiryUrl>
  org.apache.juddi.api.impl.UDDIInquiryImpl
</inquiryUrl>
<publishUrl>
  org.apache.juddi.api.impl.UDDIPublicationImpl
</publishUrl>
<securityUrl>
  org.apache.juddi.api.impl.UDDISecurityImpl
</securityUrl>
<subscriptionUrl>
  org.apache.juddi.api.impl.UDDISubscriptionImpl
</subscriptionUrl>
<subscriptionListenerUrl>
  org.apache.juddi.api.impl.UDDISubscriptionListenerImpl
</subscriptionListenerUrl>
<juddiApiUrl>
  org.apache.juddi.api.impl.JUDDIApiImpl
</juddiApiUrl>

esb.juddi.client.xml contains commented out settings for RMI and JAX-WS—if you want to change jUDDI to use one of these transports, you can simply comment out the InVM section and uncomment the pertinent transport section you wish to use.

Looking at jUDDI's database

Earlier in this chapter we mentioned that jUDDI supports multiple database providers for its database. Let's take a look at jUDDI's database and how it is created. The first time that you start up the AS server with JBoss ESB deployed, the database is automatically created. Note that, by default, the Hypersonic database is used by jUDDI (HSQLDB). This type of database is fine for learning about jUDDI, but it's not suitable for a production system where you want higher performance and scalability.

The manner in which the database is created is interesting. If you look in the juddi-ds.xml file in the server/all/deploy/jbossesb-registry.sar/ directory, you'll see:

<?xml version="1.0" encoding="UTF-8"?>

<datasources>
  <local-tx-datasource>
    <jndi-name>juddiDB</jndi-name>
    <connection-url>
      jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}juddiDB
    </connection-url>
    <driver-class>org.hsqldb.jdbcDriver</driver-class>
    <user-name>sa</user-name>
    <password></password>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>20</max-pool-size>
    <idle-timeout-minutes>0</idle-timeout-minutes>
    <prepared-statement-cache-size>32</prepared-statement-cache-size>
    <depends>jboss:service=Hypersonic,database=juddiDB</depends>
  </local-tx-datasource>
  <mbean code="org.jboss.jdbc.HypersonicDatabase"
         name="jboss:service=Hypersonic,database=juddiDB">
    <attribute name="Database">juddiDB</attribute>
    <attribute name="InProcessMode">true</attribute>
  </mbean>
  <mbean code="org.jboss.internal.soa.esb.dependencies.DatabaseInitializer"
         name="jboss.esb:service=JUDDIDatabaseInitializer">
    <attribute name="Datasource">java:/juddiDB</attribute>
    <attribute name="ExistsSql">select count from j3_publisher
    </attribute>
    <attribute name="SqlFiles">juddi-sql/hsqldb/import.sql
    </attribute>
    <depends>jboss.jca:service=DataSourceBinding,name=juddiDB
    </depends>
  </mbean>
</datasources>

The section that includes the DatabaseInitializer MBean is where the script that creates the database (juddi-sql/hsqldb/import.sql) is run. To use a database other than Hypersonic, you would edit this file and reference the database connection and driver properties. jUDDI includes database creation scripts for multiple databases unde its juddi-sql directory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset