이 콘텐츠는 선택한 언어로 제공되지 않습니다.

15.3. Using the JCA Consumer Endpoint


Procedure

To configure a JCA consumer endpoint do the following:
  1. Specify the name of the service for which this endpoint is acting as a proxy.
    This is specified using the service attribute.
  2. Specify the name of the endpoint for which this endpoint is acting as a proxy.
    This is specified using the endpoint attribute.
  3. Specify the connection factory the endpoint will use.
    The endpoint's connection factory is configured using the endpoint's connectionFactory attribute. The connectionFactory attribute's value is a reference to the bean that configures the connection factory. For example if the connection factory configuration bean is named widgetConnectionFactory, the value of the connectionFactory attribute would be #widgetConnectionFactory.
    For information on configuring a connection factory see Chapter 14, Configuring the Connection Factory.
  4. Specify the destination onto which the endpoint will place messages.
  5. Configure the JCA resource adapter that the consumer will use.
    You configure the endpoint's resource adapter using the resourceAdapter attribute. The attribute's value is a reference to the bean that configures the resource adapter.
  6. Configure the ActivationSpec object that will be used by the endpoint.
    You configure the endpoint's resource adapter using the activationSpec attribute. The attribute's value is a reference to the bean that configures the ActivationSpec object.
  7. Specify the ESB endpoint to which incoming messages are targeted.
  8. If your JMS destination is a topic, set the pubSubDomaim attribute to true.

Configuring a destination

A consumer endpoint chooses the destination to use for sending messages with the following algorithm:
  1. The endpoint will check to see if you configured the destination explicitly.
    You configure a destination using a Spring bean. You can add the bean directly to the endpoint by wrapping it in a jms:destination child element. You can also configure the bean separately and refer the bean using the endpoint's destination attribute as shown in Example 15.9, “Configuring a JCA Consumer's Destination”.

    Example 15.9. Configuring a JCA Consumer's Destination

    <beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
           ... >
      ...
      <jms:jca-consumer service="my:widgetService"
                        endpoint="jbiWidget"
                        destination="#widgetQueue"
                        ...  />
      ...
      <jee:jndi-lookup id="widgetQueue" jndi-name="my.widget.queue">
        <jee:environment>
          java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
          java.naming.provider.url=t3://localhost:7001
        </jee:environment>
      </jee:jndi-lookup>
      ...
    </beans>
    Copy to Clipboard Toggle word wrap
  2. If you did not explicitly configure a destination, the endpoint will use the value of the destinationName attribute to choose its destination.
    The value of the destinationName attribute is a string that corresponds to the name of the JMS destination. The binding component's default behavior when you provide a destination name is to resolve the destination using the standard JMS Session.createTopic() and Session.createQueue() methods.
    Note
    You can override the binding component's default behavior by providing a custom DestinationResolver implementation. See Section 19.2, “Using a Custom Destination Resolver”.

Specifying the target endpoint

There are a number of attributes available for configuring the endpoint to which the generated messages are sent. The poller endpoint will determine the target endpoint in the following manner:
  1. If you explicitly specify an endpoint using both the targetService attribute and the targetEndpoint attribute, the ESB will use that endpoint.
    The targetService attribute specifies the QName of a service deployed into the ESB. The targetEndpoint attribute specifies the name of an endpoint deployed by the service specified by the targetService attribute.
  2. If you only specify a value for the targetService attribute, the ESB will attempt to find an appropriate endpoint on the specified service.
  3. If you do not specify a service name or an endpoint name, you must specify an the name of an interface that can accept the message using the targetInterface attribute. The ESB will attempt to locate an endpoint that implements the specified interface and direct the messages to it.
    Interface names are specified as QNames. They correspond to the value of the name attribute of either a WSDL 1.1 serviceType element or a WSDL 2.0 interface element.
Important
If you specify values for more than one of the target attributes, the consumer endpoint will use the most specific information.

Example

Example 15.10, “Basic Configuration for a JCA Consumer Endpoint” shows the configuration for a JCA consumer endpoint.

Example 15.10. Basic Configuration for a JCA Consumer Endpoint

<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       ... >
  ...
  <jms:jca-consumer service="my:widgetService"
                    endpoint="jbi"
                    destinationName="widgetQueue"
                    connectionFactory="#connectionFactory"
                    resourceAdapter="#ra"
                    activationSpec="#as"
                     targetService="my:targetService" />

  <bean id="ra"
        class="org.activemq.ra.ActiveMQConnectionFactory">
    ...
  </bean>

  <bean id="as"
        class="org.apache.activemq.ra.ActiveMQActivationSpec">
    ...
  </bean>
  ...
</beans>
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat