javax.jms.QueueSession.createMessage()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中javax.jms.QueueSession.createMessage方法的一些代码示例,展示了QueueSession.createMessage的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueueSession.createMessage方法的具体详情如下:
包路径:javax.jms.QueueSession
类名称:QueueSession
方法名:createMessage

QueueSession.createMessage介绍

暂无

代码示例

代码示例来源:origin: apache/activemq

@Override
public Message createMessage() throws JMSException {
  return next.createMessage();
}

代码示例来源:origin: pierre/meteo

/**
 * @return
 * @throws JMSException
 */
public Message createMessage() throws JMSException {
  return next.createMessage();
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public Message createMessage() throws JMSException {
  return next.createMessage();
}

代码示例来源:origin: org.apache.activemq/activemq-client

@Override
public Message createMessage() throws JMSException {
  return next.createMessage();
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public Message createMessage() throws JMSException {
  return next.createMessage();
}

代码示例来源:origin: apache/activemq-artemis

/**
* Test that a <code>null</code> value is returned by the <code>Message.getObjectProperty()</code> method
* if a property by the specified name does not exits.
*/
@Test
public void testGetObjectProperty() {
 try {
   Message message = senderSession.createMessage();
   Assert.assertEquals("sec. 3.5.5 A null value is returned [by the getObjectProperty method] if a property by the specified " + "name does not exits.\n", null, message.getObjectProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* Test that a <code>null</code> value is returned by the <code>Message.getStringProperty()</code> method
* if a property by the specified name does not exits.
*/
@Test
public void testGetStringProperty() {
 try {
   Message message = senderSession.createMessage();
   Assert.assertEquals("sec. 3.5.5 A null value is returned [by the getStringProperty method] if a property by the specified " + "name does not exits.\n", null, message.getStringProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* Test that an attempt to get a <code>boolean</code> property which does not exist
* returns <code>false</code>
*/
@Test
public void testGetBooleanProperty() {
 try {
   Message message = senderSession.createMessage();
   Assert.assertEquals(false, message.getBooleanProperty("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>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 an <code>int</code>,
* it can also be read as an <code>int</code>.
*/
@Test
public void testInt2Int() {
 try {
   Message message = senderSession.createMessage();
   message.setIntProperty("prop", 127);
   Assert.assertEquals(127, message.getIntProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>short</code>,
* it can also be read as a <code>long</code>.
*/
@Test
public void testShort2Long() {
 try {
   Message message = senderSession.createMessage();
   message.setShortProperty("prop", (short) 127);
   Assert.assertEquals(127L, message.getLongProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>java.lang.String</code>,
* it can also be read as a <code>java.lang.String</code>.
*/
@Test
public void testString2String() {
 try {
   Message message = senderSession.createMessage();
   message.setStringProperty("pi", "3.14159");
   Assert.assertEquals("3.14159", message.getStringProperty("pi"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>float</code>,
* it can also be read as a <code>double</code>.
*/
@Test
public void testFloat2Double() {
 try {
   Message message = senderSession.createMessage();
   message.setFloatProperty("prop", 127.0F);
   Assert.assertEquals(127.0, message.getDoubleProperty("prop"), 0);
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as an <code>int</code>,
* it can also be read as a <code>long</code>.
*/
@Test
public void testInt2Long() {
 try {
   Message message = senderSession.createMessage();
   message.setIntProperty("prop", 127);
   Assert.assertEquals(127L, message.getLongProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>short</code>,
* it can also be read as an <code>int</code>.
*/
@Test
public void testShort2Int() {
 try {
   Message message = senderSession.createMessage();
   message.setShortProperty("prop", (short) 127);
   Assert.assertEquals(127, message.getIntProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>float</code>,
* it can also be read as a <code>String</code>.
*/
@Test
public void testFloat2String() {
 try {
   Message message = senderSession.createMessage();
   message.setFloatProperty("prop", 127.0F);
   Assert.assertEquals("127.0", message.getStringProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>byte</code>,
* it can also be read as a <code>String</code>.
*/
@Test
public void testByte2String() {
 try {
   Message message = senderSession.createMessage();
   message.setByteProperty("prop", (byte) 127);
   Assert.assertEquals("127", message.getStringProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>byte</code>,
* it can also be read as a <code>short</code>.
*/
@Test
public void testByte2Short() {
 try {
   Message message = senderSession.createMessage();
   message.setByteProperty("prop", (byte) 127);
   Assert.assertEquals((short) 127, message.getShortProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>byte</code>,
* it can also be read as a <code>byte</code>.
*/
@Test
public void testByte2Byte() {
 try {
   Message message = senderSession.createMessage();
   message.setByteProperty("prop", (byte) 127);
   Assert.assertEquals((byte) 127, message.getByteProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* if a property is set as a <code>boolean</code>,
* it can also be read as a <code>String</code>.
*/
@Test
public void testBoolean2String() {
 try {
   Message message = senderSession.createMessage();
   message.setBooleanProperty("prop", true);
   Assert.assertEquals("true", message.getStringProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}

相关文章