zoukankan      html  css  js  c++  java
  • 消费者

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

    <beans xmlns="http://www.springframework.org/schema/beans"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xmlns:p="http://www.springframework.org/schema/p"

    xmlns:context="http://www.springframework.org/schema/context"

    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd

    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

        <!-- 真正可以产生Connection的ConnectionFactory,由对应的 JMS服务厂商提供-->  

    <bean id="targetConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">  

        <property name="brokerURL" value="tcp://192.168.188.128:61616"/>  

    </bean>    

        <!-- Spring用于管理真正的ConnectionFactory的ConnectionFactory -->  

    <bean id="connectionFactory" class="org.springframework.jms.connection.SingleConnectionFactory">  

    <!-- 目标ConnectionFactory对应真实的可以产生JMS Connection的ConnectionFactory -->  

        <property name="targetConnectionFactory" ref="targetConnectionFactory"/>  

    </bean>  

        <!--这个是队列目的地,点对点的  文本信息-->  

    <bean id="queueTextDestination" class="org.apache.activemq.command.ActiveMQQueue">  

        <constructor-arg value="queue_text"/>  

    </bean>    

    <!-- 我的监听类 -->

    <bean id="myMessageListener" class="com.offcn.demo.MyMessageListener"></bean>

    <!-- 消息监听容器 -->

    <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">

    <property name="connectionFactory" ref="connectionFactory" />

    <property name="destination" ref="queueTextDestination" />

    <property name="messageListener" ref="myMessageListener" />

    </bean>     

    </beans>

  • 相关阅读:
    Orchard:打包和共享模块
    Orchard:处理1对多的关系
    SOA:服务集成成熟度模型(Service Integration Maturity Model)
    读书笔记:遇见未知的自己
    101与金根回顾敏捷个人:(83)如何组织一个学习小组
    色拉英语第2集第5幕:Do you speak English
    Orchard: Shape展现介绍
    Black Cat有声名著【1】1 Peter Pan 彼得.潘 【故事介绍】
    产品管理:孵化产品Beta流程
    色拉英语第4集第1幕: where Am I
  • 原文地址:https://www.cnblogs.com/lijun6/p/12578095.html
Copyright © 2011-2022 走看看