Skip to content

Instantly share code, notes, and snippets.

@dearshor
Created November 23, 2011 08:47
Show Gist options
  • Select an option

  • Save dearshor/1388214 to your computer and use it in GitHub Desktop.

Select an option

Save dearshor/1388214 to your computer and use it in GitHub Desktop.

Revisions

  1. dearshor created this gist Nov 23, 2011.
    22 changes: 22 additions & 0 deletions ActiveMQ-spring-config.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <!-- Embedded ActiveMQ Broker -->
    <amq:broker id="broker" useJmx="false" persistent="false">
    <amq:transportConnectors>
    <amq:transportConnector uri="tcp://localhost:0" />
    </amq:transportConnectors>
    </amq:broker>

    <!-- ActiveMQ Destination -->
    <amq:queue id="destination" physicalName="192.168.100.196" />

    <!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
    <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost" />

    <!-- JMS Producer Configuration -->
    <bean id="jmsProducerConnectionFactory"
    class="org.springframework.jms.connection.SingleConnectionFactory"
    depends-on="broker"
    p:targetConnectionFactory-ref="jmsFactory" />

    <bean id="jmsProducerTemplate" class="org.springframework.jms.core.JmsTemplate"
    p:connectionFactory-ref="jmsProducerConnectionFactory"
    p:defaultDestination-ref="destination" />