Package com.rabbitmq.client.AMQP

Examples of com.rabbitmq.client.AMQP.BasicProperties


        int previousSent = 0;
        long previousReportTime = startTime;

        long nextSummaryTime = startTime + SUMMARY_EVERY_MS;
        byte[] message = new byte[256];
        BasicProperties props = shouldPersist() ?
                MessageProperties.MINIMAL_PERSISTENT_BASIC :
                    MessageProperties.MINIMAL_BASIC;
        for (int i = 0; i < _messageCount; i++) {
            ByteArrayOutputStream acc = new ByteArrayOutputStream();
            DataOutputStream d = new DataOutputStream(acc);
View Full Code Here


    {
        if (nextPublishSeqNo > 0) {
            unconfirmedSet.add(getNextPublishSeqNo());
            nextPublishSeqNo++;
        }
        BasicProperties useProps = props;
        if (props == null) {
            useProps = MessageProperties.MINIMAL_BASIC;
        }
        transmit(new AMQCommand(new Basic.Publish.Builder()
                                    .exchange(exchange)
View Full Code Here

            Basic.GetOk getOk = (Basic.GetOk)method;
            Envelope envelope = new Envelope(getOk.getDeliveryTag(),
                                             getOk.getRedelivered(),
                                             getOk.getExchange(),
                                             getOk.getRoutingKey());
            BasicProperties props = (BasicProperties)replyCommand.getContentHeader();
            byte[] body = replyCommand.getContentBody();
            int messageCount = getOk.getMessageCount();
            return new GetResponse(envelope, props, body, messageCount);
        } else if (method instanceof Basic.GetEmpty) {
            return null;
View Full Code Here

    i.close();

    Map<String, Object> headers = new HashMap<String, Object>();
    headers.put("filename", filename);
    headers.put("length", (int) f.length());
    BasicProperties props = new BasicProperties.Builder().headers(headers).build();
    ch.basicPublish(exchange, routingKey, props, body);
    System.out.println(" done.");
      }

      conn.close();
View Full Code Here

    public void testDeadLetterPerMessageTTLRemoved() throws Exception {
        declareQueue(TEST_QUEUE_NAME, DLX, null, null, 1);
        channel.queueBind(TEST_QUEUE_NAME, "amq.direct", "test");
        channel.queueBind(DLQ, DLX, "test");

        final BasicProperties props = MessageProperties.BASIC.builder().expiration("100").build();
        publish(props, "test message");

        // The message's expiration property should have been removed, thus
        // after 100ms of hitting the queue, the message should get routed to
        // the DLQ *AND* should remain there, not getting removed after a subsequent
View Full Code Here

    @Override
    protected ProcessResult innerProcessResult(CrawlURI curi)
            throws InterruptedException {
        byte[] message = null;
        BasicProperties props = null;

        message = buildMessage(curi);
        props = amqpMessageProperties();
        try {
            amqpProducer().publishMessage(message, props);
View Full Code Here

        channel.exchangeDeclare(TEST_EXCHANGE, "topic");
        brokerSetup.declareAndBindQueue(TEST_QUEUE, TEST_EXCHANGE, routingKey);
        channel.queueDeclarePassive(TEST_QUEUE);
       
        String body = "test.body";
        channel.basicPublish(TEST_EXCHANGE, routingKey, new BasicProperties(), body.getBytes());
       
        GetResponse response = channel.basicGet(TEST_QUEUE, true);
        Assert.assertNotNull("no message in queue", response);
        Assert.assertEquals("wrong message in queue", new String(response.getBody(), "UTF-8"), body);
       
View Full Code Here

     * otherwise.
     *
     * @return The message body's charset encoding
     */
    public Charset readCharset() {
        BasicProperties basicProperties = message.getBasicProperties();
        if (basicProperties == null) {
            return Message.DEFAULT_MESSAGE_CHARSET;
        }
        String contentCharset = basicProperties.getContentEncoding();
        if (contentCharset == null) {
            return Message.DEFAULT_MESSAGE_CHARSET;
        }
        return Charset.forName(contentCharset);
    }
View Full Code Here

     * Answers the binary durability BasicProperties according
     * to the brokerChannel's durability.
     * @return BasicProperties
     */
    private BasicProperties binaryDurability() {
        BasicProperties durability = null;
        if (this.brokerChannel().isDurable()) {
            durability = MessageProperties.PERSISTENT_BASIC;
        }
        return durability;
    }
View Full Code Here

     * Answers the text durability BasicProperties according
     * to the brokerChannel's durability.
     * @return BasicProperties
     */
    private BasicProperties textDurability() {
        BasicProperties durability = null;
        if (this.brokerChannel().isDurable()) {
            durability = MessageProperties.PERSISTENT_TEXT_PLAIN;
        }
        return durability;
    }
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.