You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "colin.chi" <ib...@hotmail.com> on 2009/11/04 10:24:23 UTC

Please help me that I need to complete the following case.

I need to complete the following case.

[external client]--->cxf-bc-consumer--->jms-provider--->jms queue

jms queue--->jms-consumer--->cxf-bc-provider--->[external service]

When external service shut down, message do not roll back to jms queue(jms
is persistent and make redelivery policy on queue), then message can not be
resended.

My question is how to config servicemix to complete this case? Major
configuration is about JMS and JMS SU.

My config files as follow:

==================%SERVICEMIX_HOME%\conf\activemq.xml==================
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:amq="http://activemq.apache.org/schema/core">
  <amq:broker id="broker" depends-on="jmxServer" useShutdownHook="false"
persistent="true">
    …
    <amq:destinations>
      <amq:queue physicalName="queue/A" />
    </amq:destinations>

    <amq:destinationPolicy>
      <amq:policyMap>
        <amq:policyEntries>
          <amq:policyEntry queue=">" memoryLimit="5mb"
producerFlowControl="false">
            <amq:dispatchPolicy>
              <amq:strictOrderDispatchPolicy />
            </amq:dispatchPolicy>
            <amq:deadLetterStrategy>
              <amq:individualDeadLetterStrategy queuePrefix="DLQ."
useQueueForQueueMessages="true" />
            </amq:deadLetterStrategy>
            <amq:pendingQueuePolicy>
              <amq:vmQueueCursor />
            </amq:pendingQueuePolicy>
          </amq:policyEntry>
        </amq:policyEntries>
      </amq:policyMap>
    </amq:destinationPolicy>

    <amq:persistenceAdapter>
      <amq:amqPersistenceAdapter directory="file:./data/amq"/>
    </amq:persistenceAdapter>

    <amq:transportConnectors>
      <amq:transportConnector uri="tcp://localhost:61616"/>
    </amq:transportConnectors>

  </amq:broker>
</beans>

==============cxf-bc-consumer\src\main\resource\xbean.xml==============
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
       xmlns:csns="http://current.system/ns">
  <cxfbc:consumer wsdl="classpath:CustomerService.wsdl"
                  targetService="csns:jms"
                  targetEndpoint="provider"/>
</beans>

========cxf-bc-consumer\src\main\resource\CustomerService.wsdl========
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  name="Customer"
                  xmlns:csns="http://current.system/ns"
                  targetNamespace="http://current.system/ns"
                  xmlns:tsns="http://target.system/ns">

  <wsdl:types>
    <xs:schema attributeFormDefault="unqualified"
               elementFormDefault="unqualified"
               targetNamespace="http://target.system/ns"
               xmlns:tsns="http://target.system/ns"
               xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="createCustomer" nillable="true" type="xs:string" /> 
    </xs:schema>
  </wsdl:types>
	
  <wsdl:message name="createCustomer">
    <wsdl:part name="parameters" element="tsns:createCustomer" />
  </wsdl:message>
	
  <wsdl:portType name="CustomerServicePortType">
    <wsdl:operation name="createCustomer">
      <wsdl:input name="createCustomer" message="csns:createCustomer" />
    </wsdl:operation>
  </wsdl:portType>
	
  <wsdl:binding name="CustomerServiceBinding"
type="csns:CustomerServicePortType">
    <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="createCustomer">
      <soap:operation soapAction="" style="document" />
      <wsdl:input name="createCustomer">
        <soap:body use="literal" />
      </wsdl:input>
    </wsdl:operation>
  </wsdl:binding>
	
  <wsdl:service name="CustomerService">
    <wsdl:port name="csns:CustomerServicePortType"
binding="csns:CustomerServiceBinding">
      <soap:address
location="http://localhost:8080/ESB/services/CustomerService" />
    </wsdl:port>
  </wsdl:service>

</wsdl:definitions>

==============cxf-bc-provider\src\main\resource\xbean.xml==============
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:tsns="http://target.system/ns"
       xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0">

  <cxfbc:provider
wsdl="http://10.80.12.100:8080/targetsystem/services/CustomerAccount?wsdl"
                  service="tsns:CustomerInImplService"
                  endpoint="CustomerInGenevaPortTypePort">
  </cxfbc:provider>

</beans>

===============jms-provider\src\main\resource\xbean.xml===============
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       xmlns:csns="http://current.system/ns"
       xmlns:amq="http://activemq.org/config/1.0">

  <jms:provider service="csns:jms"
                endpoint="provider"
                destinationName="queue/A"
                connectionFactory="#connectionFactory" />

  <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616" />
    <property name="redeliveryPolicy" ref="redeliveryPolicy" />
  </bean>

  <bean id="redeliveryPolicy" class="org.apache.activemq.RedeliveryPolicy">
    <property name="initialRedeliveryDelay" value="5000"/>
    <property name="maximumRedeliveries" value="3"/>
    <property name="useExponentialBackOff" value="true" />
    <property name="backOffMultiplier" value="2" />
  </bean>

</beans>

===============jms-consumer\src\main\resource\xbean.xml===============
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       xmlns:csns="http://current.system/ns"
       xmlns:tsns="http://target.system/ns"
       xmlns:amq="http://activemq.org/config/1.0">

  <jms:consumer service="csns:jms"
                endpoint="consumer"
                targetService="tsns:CustomerInImplService"
                targetEndpoint="CustomerInGenevaPortTypePort"
                destinationName="queue/A"
                connectionFactory="#connectionFactory"
                transacted="jms"
                synchronous="true"
                marshaler="#marshaler" />

  <bean id="marshaler"
class="org.apache.servicemix.jms.endpoints.DefaultConsumerMarshaler">
    <property name="mep" value="http://www.w3.org/2004/08/wsdl/in-out" />
  </bean>

  <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616" />
    <property name="redeliveryPolicy" ref="redeliveryPolicy" />
  </bean>

  <bean id="redeliveryPolicy" class="org.apache.activemq.RedeliveryPolicy">
    <property name="initialRedeliveryDelay" value="5000"/>
    <property name="maximumRedeliveries" value="3"/>
    <property name="useExponentialBackOff" value="true" />
    <property name="backOffMultiplier" value="2" />
  </bean>

</beans>

==========================target system wsdl==========================
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  name="CustomerInImplService"
                  xmlns:tsns="http://target.system/ns"
                  targetNamespace="http://target.system/ns">

  <wsdl:types>
    <xs:schema attributeFormDefault="unqualified"
               elementFormDefault="unqualified"
               targetNamespace="http://target.system/ns"
               xmlns:tsns="http://target.system/ns"
               xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="createCustomer" nillable="true" type="xs:string" />
      <xs:element name="createCustomerResponse" nillable="true"
type="xs:string" /> 
    </xs:schema>
  </wsdl:types>

  <wsdl:message name="createCustomer">
    <wsdl:part name="parameters" element="tsns:createCustomer" />
  </wsdl:message>

  <wsdl:message name="createCustomerResponse">
    <wsdl:part name="parameters" element="tsns:createCustomerResponse" />
  </wsdl:message>

  <wsdl:portType name="CustomerInGenevaPortType">
    <wsdl:operation name="createCustomer">
      <wsdl:input name="createCustomer" message="tsns:createCustomer" />
      <wsdl:output name="createCustomerResponse"
message="tsns:createCustomerResponse" />
    </wsdl:operation>
  </wsdl:portType>

  <wsdl:binding name="CustomerInImplServiceSoapBinding"
type="tsns:CustomerInGenevaPortType">
    <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="createCustomer">
      <soap:operation soapAction="" style="document" />
      <wsdl:input name="createCustomer">
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output name="createCustomerResponse">
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="CustomerInImplService">
    <wsdl:port name="tsns:CustomerInGenevaPortTypePort"
binding="tsns:CustomerInImplServiceSoapBinding">
      <soap:address
location="http://10.80.12.100:8080/targetsystem/services/CustomerAccount" />
    </wsdl:port>
  </wsdl:service>

</wsdl:definitions>

==========================end of config file==========================

-- 
View this message in context: http://old.nabble.com/Please-help-me-that-I-need-to-complete-the-following-case.-tp26193165p26193165.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.