byte[] response = null; String corrId = UUID.randomUUID().toString(); BasicProperties props = new BasicProperties.Builder().correlationId(corrId).replyTo(replyQueue).build(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); DeflaterOutputStream defos = new DeflaterOutputStream(baos);
public void respond( String id, String response ) { log.debug( getClass().getSimpleName() + ": Trying to respond " + response + " for job " + id ); String rabbitId = id.replaceAll( "-", "" ); AMQP.BasicProperties properties = new AMQP.BasicProperties.Builder().contentType( "application/json" ).build(); try { channel.exchangeDeclare( getExchange(), "direct", false, false, null ); channel.basicPublish( getExchange(), rabbitId, properties, response.getBytes() ); } catch( IOException e ) { log.error( "Unable to respond a celery message", e ); } }
"iris", subject, new AMQP.BasicProperties.Builder() .correlationId(instanceId.toString()) .headers(headers) .build(), jsonString.getBytes() );
Visage.log.log(Level.SEVERE, "An unexpected error occurred while rendering", e); BasicProperties props = delivery.getProperties(); BasicProperties replyProps = new BasicProperties.Builder().correlationId(props.getCorrelationId()).build(); ByteArrayOutputStream ex = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(ex);
deliveryMode = Integer.parseInt(deliveryModeString); builder.deliveryMode(deliveryMode); builder.replyTo(replyTo); basicProperties = builder.build(); OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); MessageFormatter messageFormatter = null;
builder.deliveryMode(deliveryMode); builder.replyTo(replyTo); basicProperties = builder.build(); OMOutputFormat format = BaseUtils.getOMOutputFormat(msgContext); MessageFormatter messageFormatter = null;
channel.queueBind(replyQueueName, exchange, replyQueueName); String corrId = UUID.randomUUID().toString(); BasicProperties props = new Builder().correlationId(corrId).replyTo(replyQueueName).build();
channel.queueBind(replyQueueName, exchange, replyQueueName); String corrId = UUID.randomUUID().toString(); BasicProperties props = new Builder().correlationId(corrId).replyTo(replyQueueName).build();
builder.messageId(synCtx.getMessageID()); builder.deliveryMode(MessageProperties.MINIMAL_PERSISTENT_BASIC.getDeliveryMode()); builder.priority(message.getPriority(DEFAULT_PRIORITY)); channel = connection.createChannel(); if (exchangeName == null) { channel.basicPublish("", queueName, builder.build(), byteForm); } else { channel.basicPublish(exchangeName, queueName, builder.build(), byteForm);
new AMQP.BasicProperties.Builder() .correlationId(corrId) .contentType("text/plain") .replyTo(replyQueueName) .build();
new AMQP.BasicProperties.Builder() .correlationId(corrId) .contentType("text/plain") .replyTo(replyQueueName) .build();
public AMQP.BasicProperties.Builder buildProperties(Exchange exchange) { AMQP.BasicProperties.Builder properties = new AMQP.BasicProperties.Builder(); properties.contentType(contentType.toString()); properties.priority(Integer.parseInt(priority.toString())); properties.messageId(messageId.toString()); properties.clusterId(clusterId.toString()); properties.replyTo(replyTo.toString()); properties.correlationId(correlationId.toString()); properties.deliveryMode(Integer.parseInt(deliveryMode.toString())); properties.userId(userId.toString()); properties.type(type.toString()); properties.contentEncoding(contentEncoding.toString()); properties.expiration(expiration.toString()); properties.appId(appId.toString()); properties.timestamp(convertTimestamp(timestamp)); properties.headers(filteredHeaders);
deliveryMode(deliveryMode). contentType(contentType). contentEncoding(contentEncoding). messageId(messageId). replyTo(replyTo). expiration(expiration). priority(priority). correlationId(correlationId). userId(userId). appId(appId). type(type). timestamp(timestamp). headers(map). build();
"iris", subject, new AMQP.BasicProperties.Builder() .replyTo(replyQueue) .correlationId(corrId) .headers(sendheaders) .build(), jsonString.getBytes() );
@SuppressWarnings({ "rawtypes", "unchecked" }) private BasicProperties createProperties(Map<String, Object> message) { BasicProperties.Builder propsBuilder = new BasicProperties.Builder(); String contentType = (String) message.get(CONTENT_TYPE); if (!isEmpty(contentType)) { propsBuilder.contentType(contentType); propsBuilder.contentEncoding(contentEncoding); propsBuilder.headers(headers); propsBuilder.deliveryMode(deliveryMode); propsBuilder.priority(priority); propsBuilder.correlationId(correlationId); propsBuilder.replyTo(replyTo); propsBuilder.expiration(expiration); propsBuilder.messageId(messageId); propsBuilder.timestamp(timestamp); propsBuilder.type(type); propsBuilder.userId(userId); propsBuilder.appId(appId);
MINIMAL_PERSISTENT_BASIC. builder(). headers(headers). build(), payload.getBytes());
MINIMAL_PERSISTENT_BASIC. builder(). headers(headers). build(), payload.getBytes());
@SuppressWarnings({ "rawtypes", "unchecked" }) private BasicProperties createProperties(Map<String, Object> message) { BasicProperties.Builder propsBuilder = new BasicProperties.Builder(); String contentType = (String) message.get(CONTENT_TYPE); if (!isEmpty(contentType)) { propsBuilder.contentType(contentType); propsBuilder.contentEncoding(contentEncoding); propsBuilder.headers(headers); propsBuilder.deliveryMode(deliveryMode); propsBuilder.priority(priority); propsBuilder.correlationId(correlationId); propsBuilder.replyTo(replyTo); propsBuilder.expiration(expiration); propsBuilder.messageId(messageId); propsBuilder.timestamp(timestamp); propsBuilder.type(type); propsBuilder.userId(userId); propsBuilder.appId(appId);
log.info("*** Task failed, but max retries not met. Retrying ("+(times_sent+1)+"/"+this.MAX_RETRIES+"). " + "RETRYING TaskId:"+taskId+" JobId:"+jobId); AMQP.BasicProperties properties = new AMQP.BasicProperties.Builder() .contentType(message.getContentType()) .contentEncoding(message.getContentEncoding()) .headers(headers) .priority(LGConstants.QUEUE_PRIORITY_ADAPTER_RESPONSE) .build(); channel.basicPublish(message.getExchange(),message.getRoutingKey(), properties, message.getBody()); ack(msgId); payload.setPayloadType(LGConstants.LG_PAYLOAD_TYPE_ADAPTERRESPONSE_FAILURE); channel.basicPublish("", LGConstants.LEMONGRENADE_COORDINATOR , new AMQP.BasicProperties.Builder().priority(LGConstants.QUEUE_PRIORITY_ADAPTER_RESPONSE).build() , payload.toByteArray()); } catch (Exception e) {
(e -> (Object) e.getValue()))); final AMQP.BasicProperties basicProperties = new AMQP.BasicProperties.Builder().contentType(contentType) .correlationId(correlationId) .headers(stringObjectMap) .build();