Examples of exchangeDeclare()


Examples of com.rabbitmq.client.Channel.exchangeDeclare()

    this.exchange = exchange;
    Channel mq;
    try {
      mq = getChannel();
      synchronized (mq) {
        mq.exchangeDeclare(exchange, "topic", true, false, null);
      }
    } catch (IOException e) {
      errorHandler.error(e.getMessage(), e, ErrorCode.GENERIC_FAILURE);
    }
  }
View Full Code Here

Examples of com.rabbitmq.client.Channel.exchangeDeclare()

      factory.setHost("localhost");
 
      connection = factory.newConnection();
      channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "headers");

      AMQP.BasicProperties.Builder builder = new AMQP.BasicProperties.Builder();

      // MessageProperties.PERSISTENT_TEXT_PLAIN is a static instance of AMQP.BasicProperties
      // that contains a delivery mode and a priority. So we pass them to the builder.
View Full Code Here

Examples of com.rabbitmq.client.Channel.exchangeDeclare()

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost("localhost");
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "direct");

    String severity = getSeverity(argv);
    String message = getMessage(argv);

    channel.basicPublish(EXCHANGE_NAME, severity, null, message.getBytes());
View Full Code Here

Examples of com.rabbitmq.client.Channel.exchangeDeclare()

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost("localhost");
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "direct");
    String queueName = channel.queueDeclare().getQueue();
   
    if (argv.length < 1){
      System.err.println("Usage: ReceiveLogsDirect [info] [warning] [error]");
      System.exit(1);
View Full Code Here

Examples of com.rabbitmq.client.Channel.exchangeDeclare()

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost("localhost");
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "fanout");

    String message = getMessage(argv);

    channel.basicPublish(EXCHANGE_NAME, "", null, message.getBytes());
    System.out.println(" [x] Sent '" + message + "'");
View Full Code Here

Examples of com.rabbitmq.client.Channel.exchangeDeclare()

      factory.setHost("localhost");
 
      connection = factory.newConnection();
      channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");

      String routingKey = getRouting(argv);
      String message = getMessage(argv);

      channel.basicPublish(EXCHANGE_NAME, routingKey, null, message.getBytes());
View Full Code Here

Examples of com.rabbitmq.client.Channel.exchangeDeclare()

      factory.setHost("localhost");
 
      connection = factory.newConnection();
      channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");
      String queueName = channel.queueDeclare().getQueue();
      if (argv.length < 1){
        System.err.println("Usage: ReceiveLogsTopic [binding_key]...");
        System.exit(1);
View Full Code Here

Examples of com.rabbitmq.client.Channel.exchangeDeclare()

      factory.setHost("localhost");
 
      connection = factory.newConnection();
      channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "headers");

      // The API requires a routing key, but in fact if you are using a header exchange the
      // value of the routing key is not used in the routing. You can receive information
      // from the sender here as the routing key is still available in the received message.
      String routingKeyFromUser = "ourTestRoutingKey";
View Full Code Here

Examples of com.rabbitmq.client.Channel.exchangeDeclare()

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost("localhost");
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "fanout");
    String queueName = channel.queueDeclare().getQueue();
    channel.queueBind(queueName, EXCHANGE_NAME, "");
   
    System.out.println(" [*] Waiting for messages. To exit press CTRL+C");

View Full Code Here

Examples of com.rabbitmq.client.Channel.exchangeDeclare()

      }
      if (routingKey == null) {
    System.err.println("Please supply routing key to send to (-k)");
    System.exit(2);
      }
      ch.exchangeDeclare(exchange, exchangeType);

      for (String filename : cmd.getArgs()) {
    System.out.print("Sending " + filename + "...");
    File f = new File(filename);
    FileInputStream i = new FileInputStream(f);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.