当前位置: 首页>>代码示例>>Java>>正文


Java ActiveMQStreamMessage类代码示例

本文整理汇总了Java中org.apache.activemq.command.ActiveMQStreamMessage的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQStreamMessage类的具体用法?Java ActiveMQStreamMessage怎么用?Java ActiveMQStreamMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ActiveMQStreamMessage类属于org.apache.activemq.command包,在下文中一共展示了ActiveMQStreamMessage类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testStreamMessageCompression

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
@Test
public void testStreamMessageCompression() throws Exception {

   MessageConsumer consumer1 = remoteSession.createConsumer(included);
   MessageProducer producer = localSession.createProducer(included);
   producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

   waitForConsumerRegistration(localBroker, 1, included);

   StreamMessage test = localSession.createStreamMessage();

   for (int i = 0; i < 100; ++i) {
      test.writeString("test string: " + i);
   }

   producer.send(test);
   Message msg = consumer1.receive(RECEIVE_TIMEOUT_MILLS);
   assertNotNull(msg);
   ActiveMQStreamMessage message = (ActiveMQStreamMessage) msg;
   assertTrue(message.isCompressed());

   for (int i = 0; i < 100; ++i) {
      assertEquals("test string: " + i, message.readString());
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:26,代码来源:CompressionOverNetworkTest.java

示例2: transformToMap

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
/**
 * Transform an ActiveMQStreamMessage to a Map
 * 
 * @param msg - stream message to transform
 * @return map object
 * @throws JMSException
 */
protected Map transformToMap(ActiveMQStreamMessage msg) throws JMSException {
    Properties props = new Properties();

    props.putAll(transformToMap((ActiveMQMessage)msg));
    // Just set the toString of the message as the body of the stream
    // message
    props.setProperty(AmqMessagesUtil.JMS_MESSAGE_BODY_PREFIX + "JMSStreamMessage", getDisplayString(msg));

    return props;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:18,代码来源:MapTransformFilter.java

示例3: getTypeName

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
@Override
protected String getTypeName() {
    return ActiveMQStreamMessage.class.getName();
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:5,代码来源:OpenTypeSupport.java

示例4: createStreamMessage

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
@Override
public StreamMessage createStreamMessage() {
    return new ActiveMQStreamMessage();
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:5,代码来源:ActiveMQJMSVendor.java

示例5: createObject

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
/**
 * @return a new object instance
 */
public DataStructure createObject() {
    return new ActiveMQStreamMessage();
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:7,代码来源:ActiveMQStreamMessageMarshaller.java

示例6: createObject

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
@Override
public Object createObject() throws Exception {
   ActiveMQStreamMessage info = new ActiveMQStreamMessage();
   populateObject(info);
   return info;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:7,代码来源:ActiveMQStreamMessageTest.java

示例7: populateObject

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
@Override
protected void populateObject(Object object) throws Exception {
   super.populateObject(object);
   ActiveMQStreamMessage info = (ActiveMQStreamMessage) object;

}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:7,代码来源:ActiveMQStreamMessageTest.java

示例8: testTransformMessage

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
/**
 * Tests transforming messages into ActiveMQ's message implementation.
 */
public void testTransformMessage() throws Exception {
   assertTrue("Transforming a BytesMessage message into an ActiveMQBytesMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQBytesMessage(), null) instanceof ActiveMQBytesMessage);

   assertTrue("Transforming a MapMessage message to an ActiveMQMapMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQMapMessage(), null) instanceof ActiveMQMapMessage);

   assertTrue("Transforming an ObjectMessage message to an ActiveMQObjectMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQObjectMessage(), null) instanceof ActiveMQObjectMessage);

   assertTrue("Transforming a StreamMessage message to an ActiveMQStreamMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQStreamMessage(), null) instanceof ActiveMQStreamMessage);

   assertTrue("Transforming a TextMessage message to an ActiveMQTextMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQTextMessage(), null) instanceof ActiveMQTextMessage);

   assertTrue("Transforming an ActiveMQMessage message to an ActiveMQMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQMessage(), null) instanceof ActiveMQMessage);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:17,代码来源:MessageTransformationTest.java

示例9: createStreamMessage

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
/**
 * Creates a <CODE>StreamMessage</CODE> object. A
 * <CODE>StreamMessage</CODE> object is used to send a self-defining
 * stream of primitive values in the Java programming language.
 *
 * @return an ActiveMQStreamMessage
 * @throws JMSException if the JMS provider fails to create this message due
 *                 to some internal error.
 */
public StreamMessage createStreamMessage() throws JMSException {
    ActiveMQStreamMessage message = new ActiveMQStreamMessage();
    configureMessage(message);
    return message;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:15,代码来源:ActiveMQSession.java

示例10: getDataStructureType

import org.apache.activemq.command.ActiveMQStreamMessage; //导入依赖的package包/类
/**
 * Return the type of Data Structure we marshal
 * @return short representation of the type data structure
 */
public byte getDataStructureType() {
    return ActiveMQStreamMessage.DATA_STRUCTURE_TYPE;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:8,代码来源:ActiveMQStreamMessageMarshaller.java


注:本文中的org.apache.activemq.command.ActiveMQStreamMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。