title: Declare and use RabbitMQ with Spring 4 Websockets
body: <p>in our current app, we are using Spring AMQP this way:</p>
  
  <pre><code>&lt;rabbit:connection-factory  id="cachingConnectionFactory" 
                              username="${rabbitmq.connection.username}"
                              password="${rabbitmq.connection.password}"
                              host="${rabbitmq.connection.host}" 
                              port="${rabbitmq.connection.port}"
                              executor="rabbitmqPoolTaskExecutor"
                              requested-heartbeat="${rabbitmq.connection.requested-heartbeat}"
                              channel-cache-size="${rabbitmq.connection.channel-cache-size}"
                              virtual-host="${rabbitmq.connection.virtual-host}" /&gt;
  
  &lt;rabbit:admin   id="adminRabbit" 
                  connection-factory="cachingConnectionFactory"
                  auto-startup="true" /&gt;
  
  &lt;rabbit:template    id="rabbitTemplate"
                      connection-factory="cachingConnectionFactory"
                      exchange="v1.general.exchange"
                      message-converter="jsonMessageConverter" 
                      encoding="${rabbitmq.template.encoding}"
                      channel-transacted="${rabbitmq.template.channel-transacted}" /&gt;
  
  &lt;rabbit:queue id="v1.queue.1" name="v1.queue.1"  /&gt;
  &lt;rabbit:queue id="v1.queue.2" name="v1.queue.2" /&gt;
  &lt;rabbit:queue id="v1.queue.3" name="v1.queue.3" /&gt;
  
  &lt;fanout-exchange name="v1.general.exchange" xmlns="http://www.springframework.org/schema/rabbit" &gt;
      &lt;bindings&gt;
          &lt;binding queue="v1.queue.1" /&gt;
          &lt;binding queue="v1.queue.2" /&gt;
          &lt;binding queue="v1.queue.3" /&gt;
      &lt;/bindings&gt;
  &lt;/fanout-exchange&gt;
  
  &lt;listener-container xmlns="http://www.springframework.org/schema/rabbit"
                      connection-factory="cachingConnectionFactory" 
                      message-converter="jsonMessageConverter" 
                      task-executor="rabbitmqPoolTaskExecutor"
                      auto-startup="${rabbitmq.listener-container.auto-startup}"
                      concurrency="${rabbitmq.listener-container.concurrency}"
                      channel-transacted="${rabbitmq.listener-container.channel-transacted}"
                      prefetch="${rabbitmq.listener-container.prefetch}"
                      transaction-size="${rabbitmq.listener-container.transaction-size}" &gt;
  
      &lt;listener id="v1.listener.queue.1" ref="listener1" method="handleMessage" queues="v1.queue.1" /&gt;
      &lt;listener id="v1.listener.queue.2" ref="listener2" method="handleMessage" queues="v1.queue.2" /&gt;
      &lt;listener id="v1.listener.queue.3" ref="listener3" method="handleMessage" queues="v1.queue.3" /&gt;
  
  &lt;/listener-container&gt;
  
  &lt;bean id="amqpServerConnection" class="com.sub1.sub2.RabbitGatewayConnectionImpl"&gt;
      &lt;property name="rabbitTemplate" ref="rabbitTemplate" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>When I am configuring the websocket in the new Spring 4-based app I don't know how/where declare exchanges, queues, etc...</p>
  
  <pre><code>registry.enableStompBrokerRelay("/example1/", "/example2/")
              .setApplicationLogin("guest")
              .setApplicationPasscode("guest")
              .setAutoStartup(true)
              .setRelayHost("localhost")
              .setRelayPort(5672)
              .setSystemHeartbeatReceiveInterval(10000)
              .setSystemHeartbeatSendInterval(10000);
  </code></pre>
  
  <p>This stuff must be implement with AMPQ yet?</p>