Examples of exchangeDeclare()


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

      ConnectionFactory factory = new ConnectionFactory();
      factory.setHost(_mqServer);
      connection = factory.newConnection();
      Channel channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");
      String queueName = channel.queueDeclare().getQueue();

      String bindingKey = _partition;
      channel.queueBind(queueName, EXCHANGE_NAME, bindingKey);
View Full Code Here

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

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

    channel.exchangeDeclare(EXCHANGE_NAME, "topic");

    for (int i = 0; i < count; i++)
    {
      int rand = ((int) (Math.random() * 10000) % SetupConsumerCluster.DEFAULT_PARTITION_NUMBER);
      String routingKey = "topic_" + rand;
View Full Code Here

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

      ConnectionFactory factory = new ConnectionFactory();
      factory.setHost(_mqServer);
      connection = factory.newConnection();
      Channel channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");
      String queueName = channel.queueDeclare().getQueue();

      String bindingKey = _partition;
      channel.queueBind(queueName, EXCHANGE_NAME, bindingKey);
View Full Code Here

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

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

    channel.exchangeDeclare(EXCHANGE_NAME, "topic");

    for (int i = 0; i < count; i++) {
      int rand = ((int) (Math.random() * 10000) % SetupConsumerCluster.DEFAULT_PARTITION_NUMBER);
      String routingKey = "topic_" + rand;
      String message = "message_" + rand;
View Full Code Here

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

        cfconn.setHost("localhost");
        cfconn.setPort(AMQP.PROTOCOL.PORT);
        Connection conn = cfconn.newConnection();

        Channel ch = conn.createChannel();
        ch.exchangeDeclare("elasticsearch", "direct", true);
        ch.queueDeclare("elasticsearch", true, false, false, null);

        String message = "{ \"index\" : { \"index\" : \"test\", \"type\" : \"type1\", \"id\" : \"1\" }\n" +
                "{ \"type1\" : { \"field1\" : \"value1\" } }\n" +
                "{ \"delete\" : { \"index\" : \"test\", \"type\" : \"type1\", \"id\" : \"2\" } }\n" +
View Full Code Here

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

        // http://www.rabbitmq.com/api-guide.html
        // channel.exchangeDeclare(exchangeName, "direct", true);
        // String queueName = channel.queueDeclare().getQueue();
        // channel.queueBind(queueName, exchangeName, routingKey);
       
        channel.exchangeDeclare(queue, plugin.getExchangeType(), true);
        channel.queueDeclare(queue, plugin.isDurable(), false, false, null);
        channel.queueBind(queue, queue, routingKey);

        // Log Debug
        Logger.info("RabbitMQ Task Channel Available: " + channel);
View Full Code Here

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

        if (callback != null) {
            try {
                Connection connection = connectionFactory.newConnection();

                Channel channel = connection.createChannel();
                channel.exchangeDeclare(AMQPUtil.EXCHANGE_NAME_TOPIC, AMQPUtil.EXCHANGE_TYPE_TOPIC);

                String queueName = channel.queueDeclare().getQueue();
                channel.queueBind(queueName, AMQPUtil.EXCHANGE_NAME_TOPIC, topic.getNativeKey());

                QueueingConsumer consumer = new QueueingConsumer(channel);
View Full Code Here

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

    public void Send(OMElement message) throws AMQPException {
        try {
            if (isRoutable(message)) {
                Connection connection = connectionFactory.newConnection();
                Channel channel = connection.createChannel();
                channel.exchangeDeclare(AMQPUtil.EXCHANGE_NAME_FANOUT, AMQPUtil.EXCHANGE_TYPE_FANOUT);

                channel.basicPublish(AMQPUtil.EXCHANGE_NAME_FANOUT, "", null, message.toString().getBytes());

                channel.close();
                connection.close();
View Full Code Here

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

    public void Send(OMElement message) throws AMQPException {
        try {
            if (isRoutable(message)) {
                Connection connection = connectionFactory.newConnection();
                Channel channel = connection.createChannel();
                channel.exchangeDeclare(AMQPUtil.EXCHANGE_NAME_TOPIC, AMQPUtil.EXCHANGE_TYPE_TOPIC);

                List<String> routingKeys = new ArrayList<String>();
                getRoutingKeys(message, routingKeys);

                for (String routingKey : routingKeys) {
View Full Code Here

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

        if (callback != null) {
            try {
                Connection connection = connectionFactory.newConnection();

                Channel channel = connection.createChannel();
                channel.exchangeDeclare(AMQPUtil.EXCHANGE_NAME_FANOUT, AMQPUtil.EXCHANGE_TYPE_FANOUT);

                String queueName = channel.queueDeclare().getQueue();
                channel.queueBind(queueName, AMQPUtil.EXCHANGE_NAME_FANOUT, "");

                QueueingConsumer consumer = new QueueingConsumer(channel);
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.