[rabbitmq-discuss] basicConsume() change in 2.0 Java client

Mark Fisher markfisher at vmware.com
Fri Aug 27 17:34:35 BST 2010


In 1.8.1, the following basicConsume() method existed on Channel:
    String basicConsume(String queue, boolean noAck, String consumerTag, boolean noLocal, boolean exclusive, Consumer callback) throws IOException;

In 2.0.0, that particular signature is no longer available, but a new version containing a "filter" Map as the penultimate argument does exist. However, as shown below, there is no documentation for that argument in the JavaDoc. Could someone please explain the role of the "filter"?... and is NULL allowed?

    /**
     * Start a consumer. Calls the consumer's {@link Consumer#handleConsumeOk}
     * method before returning.
     * @param queue the name of the queue
     * @param noAck true if no handshake is required
     * @param consumerTag a client-generated consumer tag to establish context
     * @param noLocal flag set to true unless server local buffering is required
     * @param exclusive true if this is an exclusive consumer
     * @param callback an interface to the consumer object
     * @return the consumerTag associated with the new consumer
     * @throws java.io.IOException if an error is encountered
     * @see com.rabbitmq.client.AMQP.Basic.Consume
     * @see com.rabbitmq.client.AMQP.Basic.ConsumeOk
     */
    String basicConsume(String queue, boolean noAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String, Object> filter, Consumer callback) throws IOException;

Thanks,
Mark


More information about the rabbitmq-discuss mailing list