Exemplo n.º 1
0
 void send(int count) throws JMSException, IOException {
   // create a publisher
   MessageProducer producer = _session.createProducer(_destination);
   for (int i = 0; i < count; i++) {
     BytesMessage msg = _session.createBytesMessage();
     msg.writeBytes(_expected.getDataAsBytes());
     producer.send(msg);
   }
 }
Exemplo n.º 2
0
  public void testBindQueue() throws Exception {
    AMQQueue queue = createTestQueue(QUEUE_NAME, "queueOwner", false);
    Binding binding =
        new Binding(
            UUIDGenerator.generateRandomUUID(),
            ROUTING_KEY,
            queue,
            _exchange,
            FieldTable.convertToMap(_bindingArgs));
    _store.bindQueue(binding);

    reopenStore();

    ByteBuffer argsAsBytes = ByteBuffer.wrap(_bindingArgs.getDataAsBytes());

    verify(_bindingRecoveryHandler)
        .binding(binding.getId(), _exchange.getId(), queue.getId(), ROUTING_KEY, argsAsBytes);
  }