Example usage for javax.jms ObjectMessage setIntProperty

List of usage examples for javax.jms ObjectMessage setIntProperty

Introduction

In this page you can find the example usage for javax.jms ObjectMessage setIntProperty.

Prototype


void setIntProperty(String name, int value) throws JMSException;

Source Link

Document

Sets an int property value with the specified name into the message.

Usage

From source file:net.ab0oo.aprs.clients.SimpleMessageProducer.java

public void sendMessage(final Serializable payload) throws JMSException {
    jmsTemplate.send(new MessageCreator() {
        @Override/*from  w w w.  j  a v a  2 s.  c  om*/
        public Message createMessage(Session session) throws JMSException {
            ObjectMessage message = session.createObjectMessage(payload);
            message.setIntProperty("messageCount", i);
            return message;
        }
    });
    i++;
}

From source file:org.osgp.adapter.protocol.dlms.infra.messaging.DlmsLogItemRequestMessageSender.java

public void send(final DlmsLogItemRequestMessage dlmsLogItemRequestMessage) {

    LOGGER.debug("Sending DlmsLogItemRequestMessage");

    this.dlmsLogItemRequestsJmsTemplate.send(new MessageCreator() {
        @Override//from  w  w w. ja v  a2  s  .  com
        public Message createMessage(final Session session) throws JMSException {
            final ObjectMessage objectMessage = session.createObjectMessage();
            objectMessage.setJMSType(Constants.DLMS_LOG_ITEM_REQUEST);
            objectMessage.setStringProperty(Constants.IS_INCOMING,
                    dlmsLogItemRequestMessage.isIncoming().toString());
            objectMessage.setStringProperty(Constants.ENCODED_MESSAGE,
                    dlmsLogItemRequestMessage.getEncodedMessage());
            objectMessage.setStringProperty(Constants.DECODED_MESSAGE,
                    dlmsLogItemRequestMessage.getDecodedMessage());
            objectMessage.setStringProperty(Constants.DEVICE_IDENTIFICATION,
                    dlmsLogItemRequestMessage.getDeviceIdentification());
            objectMessage.setStringProperty(Constants.IS_VALID, dlmsLogItemRequestMessage.isValid().toString());
            objectMessage.setIntProperty(Constants.PAYLOAD_MESSAGE_SERIALIZED_SIZE,
                    dlmsLogItemRequestMessage.getPayloadMessageSerializedSize());
            return objectMessage;
        }
    });
}

From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.messaging.Iec61850LogItemRequestMessageSender.java

public void send(final Iec61850LogItemRequestMessage iec61850LogItemRequestMessage) {

    LOGGER.debug("Sending Iec61850LogItemRequestMessage");

    this.iec61850LogItemRequestsJmsTemplate.send(new MessageCreator() {
        @Override//from w ww.j a v a2s.c o m
        public Message createMessage(final Session session) throws JMSException {
            final ObjectMessage objectMessage = session.createObjectMessage();
            objectMessage.setJMSType(Constants.IEC61850_LOG_ITEM_REQUEST);
            objectMessage.setStringProperty(Constants.IS_INCOMING,
                    iec61850LogItemRequestMessage.isIncoming().toString());
            objectMessage.setStringProperty(Constants.ENCODED_MESSAGE,
                    iec61850LogItemRequestMessage.getEncodedMessage());
            objectMessage.setStringProperty(Constants.DECODED_MESSAGE,
                    iec61850LogItemRequestMessage.getDecodedMessage());
            objectMessage.setStringProperty(Constants.DEVICE_IDENTIFICATION,
                    iec61850LogItemRequestMessage.getDeviceIdentification());
            objectMessage.setStringProperty(Constants.IS_VALID,
                    iec61850LogItemRequestMessage.isValid().toString());
            objectMessage.setIntProperty(Constants.PAYLOAD_MESSAGE_SERIALIZED_SIZE,
                    iec61850LogItemRequestMessage.getPayloadMessageSerializedSize());
            return objectMessage;
        }
    });
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.OslpLogItemRequestMessageSender.java

public void send(final OslpLogItemRequestMessage oslpLogItemRequestMessage) {

    LOGGER.debug("Sending OslpLogItemRequestMessage");

    this.oslpLogItemRequestsJmsTemplate.send(new MessageCreator() {
        @Override//from w  w w  .  java  2  s.  c om
        public Message createMessage(final Session session) throws JMSException {
            final ObjectMessage objectMessage = session.createObjectMessage();
            objectMessage.setJMSType(Constants.OSLP_LOG_ITEM_REQUEST);
            objectMessage.setStringProperty(Constants.IS_INCOMING,
                    oslpLogItemRequestMessage.isIncoming().toString());
            objectMessage.setStringProperty(Constants.DEVICE_UID, oslpLogItemRequestMessage.getDeviceUid());
            objectMessage.setStringProperty(Constants.ENCODED_MESSAGE,
                    oslpLogItemRequestMessage.getEncodedMessage());
            objectMessage.setStringProperty(Constants.DECODED_MESSAGE,
                    oslpLogItemRequestMessage.getDecodedMessage());
            objectMessage.setStringProperty(Constants.DEVICE_IDENTIFICATION,
                    oslpLogItemRequestMessage.getDeviceIdentification());
            objectMessage.setStringProperty(Constants.ORGANISATION_IDENTIFICATION,
                    oslpLogItemRequestMessage.getOrganisationIdentification());
            objectMessage.setStringProperty(Constants.IS_VALID, oslpLogItemRequestMessage.isValid().toString());
            objectMessage.setIntProperty(Constants.PAYLOAD_MESSAGE_SERIALIZED_SIZE,
                    oslpLogItemRequestMessage.getPayloadMessageSerializedSize());
            return objectMessage;
        }
    });
}

From source file:com.alliander.osgp.adapter.protocol.iec61850.infra.messaging.DeviceResponseMessageSender.java

private void sendMessage(final ProtocolResponseMessage responseMessage) {
    this.iec61850ResponsesJmsTemplate.send(new MessageCreator() {
        @Override/*from w ww .j  a v  a  2  s.c om*/
        public Message createMessage(final Session session) throws JMSException {
            final ObjectMessage objectMessage = session.createObjectMessage(responseMessage);
            objectMessage.setJMSCorrelationID(responseMessage.getCorrelationUid());
            objectMessage.setStringProperty(Constants.DOMAIN, responseMessage.getDomain());
            objectMessage.setStringProperty(Constants.DOMAIN_VERSION, responseMessage.getDomainVersion());
            objectMessage.setJMSType(responseMessage.getMessageType());
            objectMessage.setStringProperty(Constants.ORGANISATION_IDENTIFICATION,
                    responseMessage.getOrganisationIdentification());
            objectMessage.setStringProperty(Constants.DEVICE_IDENTIFICATION,
                    responseMessage.getDeviceIdentification());
            objectMessage.setStringProperty(Constants.RESULT, responseMessage.getResult().toString());
            if (responseMessage.getOsgpException() != null) {
                objectMessage.setStringProperty(Constants.DESCRIPTION,
                        responseMessage.getOsgpException().getMessage());
            }
            objectMessage.setBooleanProperty(Constants.IS_SCHEDULED, responseMessage.isScheduled());
            objectMessage.setIntProperty(Constants.RETRY_COUNT, responseMessage.getRetryCount());
            return objectMessage;
        }
    });
}

From source file:com.alliander.osgp.adapter.protocol.oslp.elster.infra.messaging.DeviceResponseMessageSender.java

private void sendMessage(final ProtocolResponseMessage responseMessage) {
    this.oslpResponsesJmsTemplate.send(new MessageCreator() {
        @Override// www.  j a va  2  s  .c o  m
        public Message createMessage(final Session session) throws JMSException {
            final ObjectMessage objectMessage = session.createObjectMessage(responseMessage);
            objectMessage.setJMSCorrelationID(responseMessage.getCorrelationUid());
            objectMessage.setStringProperty(Constants.DOMAIN, responseMessage.getDomain());
            objectMessage.setStringProperty(Constants.DOMAIN_VERSION, responseMessage.getDomainVersion());
            objectMessage.setJMSType(responseMessage.getMessageType());
            objectMessage.setStringProperty(Constants.ORGANISATION_IDENTIFICATION,
                    responseMessage.getOrganisationIdentification());
            objectMessage.setStringProperty(Constants.DEVICE_IDENTIFICATION,
                    responseMessage.getDeviceIdentification());
            objectMessage.setStringProperty(Constants.RESULT, responseMessage.getResult().toString());
            if (responseMessage.getOsgpException() != null) {
                objectMessage.setStringProperty(Constants.DESCRIPTION,
                        responseMessage.getOsgpException().getMessage());
            }
            objectMessage.setBooleanProperty(Constants.IS_SCHEDULED, responseMessage.isScheduled());
            objectMessage.setIntProperty(Constants.RETRY_COUNT, responseMessage.getRetryCount());
            return objectMessage;
        }
    });
}

From source file:org.osgp.adapter.protocol.dlms.infra.messaging.DeviceResponseMessageSender.java

private void sendMessage(final ProtocolResponseMessage responseMessage) {
    this.dlmsResponsesJmsTemplate.setPriority(responseMessage.getMessagePriority());
    this.dlmsResponsesJmsTemplate.send(new MessageCreator() {

        @Override//  w ww.  j a  v a  2 s .c o  m
        public Message createMessage(final Session session) throws JMSException {
            final ObjectMessage objectMessage = session.createObjectMessage(responseMessage);
            objectMessage.setJMSCorrelationID(responseMessage.getCorrelationUid());
            objectMessage.setStringProperty(Constants.DOMAIN, responseMessage.getDomain());
            objectMessage.setStringProperty(Constants.DOMAIN_VERSION, responseMessage.getDomainVersion());
            objectMessage.setJMSType(responseMessage.getMessageType());
            objectMessage.setStringProperty(Constants.ORGANISATION_IDENTIFICATION,
                    responseMessage.getOrganisationIdentification());
            objectMessage.setStringProperty(Constants.DEVICE_IDENTIFICATION,
                    responseMessage.getDeviceIdentification());
            objectMessage.setStringProperty(Constants.RESULT, responseMessage.getResult().toString());
            if (responseMessage.getOsgpException() != null) {
                objectMessage.setStringProperty(Constants.DESCRIPTION,
                        responseMessage.getOsgpException().getMessage());
            }
            objectMessage.setBooleanProperty(Constants.IS_SCHEDULED, responseMessage.isScheduled());
            objectMessage.setIntProperty(Constants.RETRY_COUNT, responseMessage.getRetryCount());
            return objectMessage;
        }

    });
}