Results 1 to 3 of 3

Thread: SOAP over JMS 1.0 RC1

  1. #1
    Join Date
    Jan 2007
    Posts
    2

    Default SOAP over JMS 1.0 RC1

    Hi There,

    In attempt to follow the SOAP over JMS 1.0 RC1 developed by TIBCO, IBM, BEA, SONIC, etc, our architect has enforced the use of UDDI to obtained JNDI lookup and configuration to obtain ConnectionFactory and Queue.

    So basically I have the following configuration, which is standard but the values in red must be retrieved dynamically from UDDI and only if that fails, should we use the default value written in the config file. I have got a UDDI lookup class and I need to update these values. What would be the best way of doing it?

    <bean id="jndiTemplateESB" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
    <props>
    <prop key="java.naming.factory.initial">com.tibco.tibjms.naming.TibjmsInitialContextFactor y</prop>
    <prop key="java.naming.provider.url">tibjmsnaming://taurems01p:7243</prop>
    <prop key="java.naming.factory.url.pkgs">com.tibco.tibjms.naming</prop>
    <prop key="java.naming.security.credentials">password</prop>
    <prop key="java.naming.security.principal">user</prop>
    <prop key="com.tibco.tibjms.naming.ssl_trusted_certs">se rver_root.cert.pem</prop>
    <prop key="com.tibco.tibjms.naming.security_protocol">ss l</prop>
    </props>
    </property>
    </bean>
    <bean id="connectionFactoryESB" class="jms.spring.TibcoConnectionFactoryObjectFact oryBean">
    <property name="jndiTemplate">
    <ref bean="jndiTemplateESB"/>
    </property>
    <property name="jndiName">
    <value>SSLQueueConnectionFactory</value>
    </property>
    <property name="userName">
    <value>username</value>
    </property>
    <property name="userPassword">
    <value>password</value>
    </property>
    </bean>
    <bean id="destinationHoldingService" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiTemplate">
    <ref bean="jndiTemplateESB"/>
    </property>
    <property name="jndiName">
    <value>sdk.ssl.poc.request.v1</value>
    </property>
    <property name="cache" value="true"/>
    </bean>

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    I would create a factory (your lookup class maybe) which connects to the UDDI registry and tries to retrieve values from there. Also make it configurable on which default values to use. Then next I would use that factory bean to inject values into the other beans.

    For injecting properties from one bean into another bean you might want to check the PropertyPathFactoryBean

    Configuration might look something like this, I used the Spring 2.0 schema functionality.
    Code:
    <bean id="uddiRegistry" class="com.yourcompany.UddiLookupServiceBean">
      <!-- Configure defaults here -->
      <property name="url" value="tibjmsnaming://taurems01p:7243"/>
      <property name="pkgs" value="com.tibco.tibjms.naming"/>
      <property name="contextFactory" value="com.tibco.tibjms.naming.TibjmsInitialContextFactory"/>
      <property name="connectionFactory" value=">SSLQueueConnectionFactory</"/>
      <property name="jndiName" value="sdk.ssl.poc.request.v1"/>
    </bean>
    
    <util:property-path id="url" path="uddiRegistry.url"/>
    <util:property-path id="pkgs" path="uddiRegistry.pkgs"/>
    <util:property-path id="contextFactory" path="uddiRegistry.contextFactory"/>
    <util:property-path id="connectionFactory" path="uddiRegistry.connectionFactory"/>
    <util:property-path id="jndiName" path="uddiRegistry.jndiName"/>
    And in your initial configuration you would then refere to the id's mentioned in the utilroperty-path id's. Which would make your configuration something like this.

    Code:
    <bean id="jndiTemplateESB" class="org.springframework.jndi.JndiTemplate">
      <property name="environment">
        <props>
          <prop key="java.naming.factory.initial"><ref bean="contextFactory"/></prop>
          <prop key="java.naming.provider.url"><ref bean="url"/></prop>
          <prop key="java.naming.factory.url.pkgs"><ref bean="pkgs"/></prop>
          <prop key="java.naming.security.credentials">password</prop>
          <prop key="java.naming.security.principal">user</prop>
          <prop key="com.tibco.tibjms.naming.ssl_trusted_certs">se rver_root.cert.pem</prop>
          <prop key="com.tibco.tibjms.naming.security_protocol">ss l</prop>
        </props>
      </property>
    </bean>
    
    <bean id="connectionFactoryESB" class="jms.spring.TibcoConnectionFactoryObjectFact oryBean">
      <property name="jndiTemplate" ref="jndiTemplateESB"/>
      <property name="jndiName" ref="connectionFactory"/>
      <property name="userName" value="username">
      <property name="userPassword" value="password"/>
    </bean>
    
    <bean id="destinationHoldingService" class="org.springframework.jndi.JndiObjectFactoryB ean">
      <property name="jndiTemplate" ref="jndiTemplateESB"/>
      <property name="jndiName" ref="jndiName"/>
      <property name="cache" value="true"/>
    </bean>
    Last edited by Marten Deinum; Jan 15th, 2007 at 03:04 AM. Reason: Added example configuration
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Jan 2007
    Posts
    2

    Default

    Thanks, that's a good suggestion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •