Package com.rabbitmq.client.AMQP

Examples of com.rabbitmq.client.AMQP.BasicProperties


    public static MessageParameters durableTextParameters(
            String aType,
            String aMessageId,
            Date aTimestamp) {

        BasicProperties properties =
            new BasicProperties(
                    "text/plain",   // contentType
                    null,           // contentEncoding
                    null,           // headers
                    2,              // deliveryMode, persistent
                    0,              // priority
View Full Code Here


    public static MessageParameters textParameters(
            String aType,
            String aMessageId,
            Date aTimestamp) {

        BasicProperties properties =
            new BasicProperties(
                    "text/plain",   // contentType
                    null,           // contentEncoding
                    null,           // headers
                    1,              // deliveryMode, non-persistent
                    0,              // priority
View Full Code Here

   */
  public static BasicProperties getBasicProperties() {
    if (isDurable() == false) {
      return null;
    }
    BasicProperties b = MessageProperties.PERSISTENT_TEXT_PLAIN;
    return b;
  }
View Full Code Here

    container.setChannelTransacted(true);
    container.setShutdownTimeout(100);
    container.afterPropertiesSet();
    container.start();

    consumer.get().handleDelivery("qux", new Envelope(1, false, "foo", "bar"), new BasicProperties(), new byte[] {0});

    assertTrue(latch.await(10, TimeUnit.SECONDS));

    Exception e = tooManyChannels.get();
    if (e != null) {
View Full Code Here

    container.setChannelTransacted(true);
    container.setShutdownTimeout(100);
    container.afterPropertiesSet();
    container.start();

    consumer.get().handleDelivery("qux", new Envelope(1, false, "foo", "bar"), new BasicProperties(), new byte[] {0});

    assertTrue(latch.await(10, TimeUnit.SECONDS));

    Exception e = tooManyChannels.get();
    if (e != null) {
View Full Code Here

    container.setExposeListenerChannel(false);
    container.setShutdownTimeout(100);
    container.afterPropertiesSet();
    container.start();

    consumer.get().handleDelivery("qux", new Envelope(1, false, "foo", "bar"), new BasicProperties(), new byte[] {0});

    assertTrue(latch.await(10, TimeUnit.SECONDS));

    Exception e = tooManyChannels.get();
    if (e != null) {
View Full Code Here

      public void onMessage(Message message) {
        messages.add(message);
      }
    });
    container.start();
    BasicProperties props = new BasicProperties();
    byte[] payload = "baz".getBytes();
    Envelope envelope = new Envelope(1L, false, "foo", "bar");
    consumer.get().handleDelivery("1", envelope, props, payload);
    envelope = new Envelope(2L, false, "foo", "bar");
    consumer.get().handleDelivery("1", envelope, props, payload);
View Full Code Here

      public void onMessage(Message message) {
        messages.add(message);
      }
    });
    container.start();
    BasicProperties props = new BasicProperties();
    byte[] payload = "baz".getBytes();
    Envelope envelope = new Envelope(1L, false, "foo", "bar");
    consumer.get().handleDelivery("1", envelope, props, payload);
    envelope = new Envelope(2L, false, "foo", "bar");
    consumer.get().handleDelivery("1", envelope, props, payload);
View Full Code Here

  @Test
  public void testToMessagePropertiesLongString() {
    Map<String, Object> headers = new HashMap<String, Object>();
    headers.put("longString", longString);
    BasicProperties source = new BasicProperties.Builder()
        .headers(headers)
        .build();
    MessageProperties messageProperties = messagePropertiesConverter.toMessageProperties(source, envelope, "UTF-8");
    assertEquals("LongString not converted to String",
        longStringString, messageProperties.getHeaders().get("longString"));
View Full Code Here

  @Test
  public void testToMessagePropertiesLongStringInList() {
    Map<String, Object> headers = new HashMap<String, Object>();
    headers.put("list", Arrays.asList(longString));
    BasicProperties source = new BasicProperties.Builder()
        .headers(headers)
        .build();
    MessageProperties messageProperties = messagePropertiesConverter.toMessageProperties(source, envelope, "UTF-8");
    assertEquals("LongString nested in List not converted to String",
        longStringString, ((List<?>) messageProperties.getHeaders().get("list")).get(0));
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.AMQP.BasicProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.