本文整理了Java中javax.jms.Message.setLongProperty()
方法的一些代码示例,展示了Message.setLongProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.setLongProperty()
方法的具体详情如下:
包路径:javax.jms.Message
类名称:Message
方法名:setLongProperty
[英]Sets a long property value with the specified name into the message.
[中]在消息中设置具有指定名称的长属性值。
代码示例来源:origin: apache/nifi
message.setShortProperty(jmsPropName, Short.parseShort(value));
} else if (type.equalsIgnoreCase(PROP_TYPE_LONG)) {
message.setLongProperty(jmsPropName, Long.parseLong(value));
} else if (type.equalsIgnoreCase(PROP_TYPE_BYTE)) {
message.setByteProperty(jmsPropName, Byte.parseByte(value));
代码示例来源:origin: org.apache.tomee/openejb-core
@Override
public void setLongProperty(final String name, final long value) throws JMSException {
message.setLongProperty(name, value);
}
代码示例来源:origin: org.jboss.jbossas/jboss-as-connector
public void setLongProperty(String name, long value) throws JMSException
{
message.setLongProperty(name, value);
}
代码示例来源:origin: com.centurylink.mdw/mdw-common
public void setMessageDelay(QueueSender sender, Message message, long delaySeconds) throws JMSException {
message.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, delaySeconds * 1000);
}
代码示例来源:origin: org.jboss.genericjms/generic-jms-ra-jar
public void setLongProperty(String name, long value) throws JMSException {
message.setLongProperty(name, value);
}
代码示例来源:origin: org.apache.qpid/qpid-jca
/**
* Set property
* @param name The name
* @param value The value
* @exception JMSException Thrown if an error occurs
*/
public void setLongProperty(final String name, final long value) throws JMSException
{
if (_log.isTraceEnabled())
{
_log.trace("setLongProperty(" + name + ", " + value + ")");
}
_message.setLongProperty(name, value);
}
代码示例来源:origin: apache/activemq-artemis
/**
* Set property
*
* @param name The name
* @param value The value
* @throws JMSException Thrown if an error occurs
*/
@Override
public void setLongProperty(final String name, final long value) throws JMSException {
if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
ActiveMQRALogger.LOGGER.trace("setLongProperty(" + name + ", " + value + ")");
}
message.setLongProperty(name, value);
}
代码示例来源:origin: org.apache.activemq/artemis-ra
/**
* Set property
*
* @param name The name
* @param value The value
* @throws JMSException Thrown if an error occurs
*/
@Override
public void setLongProperty(final String name, final long value) throws JMSException {
if (ActiveMQRALogger.LOGGER.isTraceEnabled()) {
ActiveMQRALogger.LOGGER.trace("setLongProperty(" + name + ", " + value + ")");
}
message.setLongProperty(name, value);
}
代码示例来源:origin: apache/activemq-artemis
public static Message sendMessageWithProperty(final Session session,
final Destination destination,
final String key,
final long value) throws JMSException {
MessageProducer producer = session.createProducer(destination);
Message message = session.createMessage();
message.setLongProperty(key, value);
producer.send(message);
return message;
}
代码示例来源:origin: techa03/goodsKill
@Override
public Message createMessage(Session session) throws JMSException {
Message message = session.createMessage();
message.setLongProperty("seckillId", finalSeckillId);
message.setBooleanProperty("status", true);
message.setStringProperty("note", note);
return message;
}
});
代码示例来源:origin: Nepxion/Thunder
@Override
public Message createMessage(Session session) throws JMSException {
Message message = mqMessageConverter.toMessage(response, session);
message.setBooleanProperty(ThunderConstant.ASYNC_ATTRIBUTE_NAME, response.isAsync());
message.setLongProperty(ThunderConstant.TIMEOUT_ATTRIBUTE_NAME, response.getTimeout());
MQSelectorUtil.setRequestSelector(message, selector);
MQSelectorUtil.setResponseSelector(message, applicationEntity);
return message;
}
});
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>long</code>,
* it can also be read as a <code>long</code>.
*/
@Test
public void testLong2Long() {
try {
Message message = senderSession.createMessage();
message.setLongProperty("prop", 127L);
Assert.assertEquals(127L, message.getLongProperty("prop"));
} catch (JMSException e) {
fail(e);
}
}
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>long</code>,
* it can also be read as a <code>String</code>.
*/
@Test
public void testLong2String() {
try {
Message message = senderSession.createMessage();
message.setLongProperty("prop", 127L);
Assert.assertEquals("127", message.getStringProperty("prop"));
} catch (JMSException e) {
fail(e);
}
}
代码示例来源:origin: apache/activemq-artemis
private void sendMessageUsingOpenWire(String queueName) throws Exception {
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE);
System.out.println("destination: " + destination);
final ActiveMQMessageProducer producer = (ActiveMQMessageProducer) session.createProducer(destination);
javax.jms.Message message = session.createMessage();
message.setBooleanProperty("booleanProperty", false);
message.setLongProperty("longProperty", 99999L);
message.setByteProperty("byteProperty", (byte) 5);
message.setIntProperty("intProperty", 979);
message.setShortProperty("shortProperty", (short) 1099);
message.setStringProperty("stringProperty", "HelloMessage");
producer.send(message);
}
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>long</code>,
* to get is as a <code>byte</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testLong2Byte() {
try {
Message message = senderSession.createMessage();
// store a value that can't be converted to byte
message.setLongProperty("prop", 127L);
message.getByteProperty("prop");
Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
} catch (MessageFormatException e) {
} catch (JMSException e) {
fail(e);
}
}
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>long</code>,
* to get is as a <code>float</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testLong2Float() {
try {
Message message = senderSession.createMessage();
message.setLongProperty("prop", 127L);
message.getFloatProperty("prop");
Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
} catch (MessageFormatException e) {
} catch (JMSException e) {
fail(e);
}
}
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>long</code>,
* to get is as an <code>int</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testLong2Int() {
try {
Message message = senderSession.createMessage();
message.setLongProperty("prop", 127L);
message.getIntProperty("prop");
Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
} catch (MessageFormatException e) {
} catch (JMSException e) {
fail(e);
}
}
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>long</code>,
* to get is as a <code>double</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testLong2Double() {
try {
Message message = senderSession.createMessage();
message.setLongProperty("prop", 127L);
message.getDoubleProperty("prop");
Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
} catch (MessageFormatException e) {
} catch (JMSException e) {
fail(e);
}
}
代码示例来源:origin: apache/activemq-artemis
/**
* if a property is set as a <code>long</code>,
* to get is as a <code>boolean</code> throws a <code>javax.jms.MessageFormatException</code>.
*/
@Test
public void testLong2Boolean() {
try {
Message message = senderSession.createMessage();
// store a value that can be converted to boolean
message.setLongProperty("prop", 127L);
message.getBooleanProperty("prop");
Assert.fail("sec. 3.5.4 The unmarked cases [of Table 0-4] should raise a JMS MessageFormatException.\n");
} catch (MessageFormatException e) {
} catch (JMSException e) {
fail(e);
}
}
代码示例来源:origin: apache/activemq-artemis
protected void prepareMessage(final Message m) throws JMSException {
m.setBooleanProperty("booleanProperty", true);
m.setByteProperty("byteProperty", (byte) 3);
m.setDoubleProperty("doubleProperty", 4.0);
m.setFloatProperty("floatProperty", 5.0f);
m.setIntProperty("intProperty", 6);
m.setLongProperty("longProperty", 7);
m.setShortProperty("shortProperty", (short) 8);
m.setStringProperty("stringProperty", "this is a String property");
m.setJMSCorrelationID("this is the correlation ID");
m.setJMSReplyTo(ActiveMQServerTestCase.topic1);
m.setJMSType("someArbitraryType");
}
内容来源于网络,如有侵权,请联系作者删除!