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


C# ISession.CreateBytesMessage方法代码示例

本文整理汇总了C#中ISession.CreateBytesMessage方法的典型用法代码示例。如果您正苦于以下问题:C# ISession.CreateBytesMessage方法的具体用法?C# ISession.CreateBytesMessage怎么用?C# ISession.CreateBytesMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISession的用法示例。


在下文中一共展示了ISession.CreateBytesMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Encode

        public IMessage Encode(TransportMessage message, ISession session)
        {
            if (message.IsControlMessage())
            {
                IMessage encoded = session.CreateBytesMessage();

                if (message.Body != null)
                {
                    encoded = session.CreateBytesMessage(message.Body);
                }

                return encoded;
            }

            return null;
        }
开发者ID:afyles,项目名称:NServiceBus,代码行数:16,代码来源:ControlMessageEncoder.cs

示例2: Encode

        public IMessage Encode(TransportMessage message, ISession session)
        {
            var contentType = message.Headers[Headers.ContentType];

            if (contentType == ContentTypes.Bson || contentType == ContentTypes.Binary)
            {
                IMessage encoded = session.CreateBytesMessage();

                if (message.Body != null)
                {
                    encoded = session.CreateBytesMessage(message.Body);
                }

                return encoded;
            }

            return null;
        }
开发者ID:modulexcite,项目名称:NServiceBus.ActiveMQ,代码行数:18,代码来源:ByteMessageEncoder.cs

示例3: CreateMessageForByteArray

 /// <summary> Create a NMS IBytesMessage for the given byte array.</summary>
 /// <param name="bytes">the byyte array to convert
 /// </param>
 /// <param name="session">current NMS session
 /// </param>
 /// <returns> the resulting message
 /// </returns>
 /// <throws>  NMSException if thrown by NMS methods </throws>
 protected virtual IBytesMessage CreateMessageForByteArray(byte[] bytes, ISession session)
 {
     IBytesMessage message = session.CreateBytesMessage();
     message.Content = bytes;
     return message;
 }
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:14,代码来源:SimpleMessageConverter.cs

示例4: CreateMessageForByteArray

 /// <summary> Create a EMS BytesMessage for the given byte array.</summary>
 /// <param name="bytes">the byyte array to convert
 /// </param>
 /// <param name="session">current EMS session
 /// </param>
 /// <returns> the resulting message
 /// </returns>
 /// <throws>  EMSException if thrown by EMS methods </throws>
 protected virtual BytesMessage CreateMessageForByteArray(byte[] bytes, ISession session)
 {
     BytesMessage message = session.CreateBytesMessage();
     message.WriteBytes(bytes);
     return message;
 }
开发者ID:Binodesk,项目名称:spring-net,代码行数:14,代码来源:SimpleMessageConverter.cs


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