public void TestBytesMessageCompression() { using (Connection connection = CreateConnection(TEST_CLIENT_ID) as Connection) { connection.UseCompression = true; connection.Start(); using (ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge)) { IDestination destination = session.CreateTemporaryQueue(); using (IMessageConsumer consumer = session.CreateConsumer(destination)) using (IMessageProducer producer = session.CreateProducer(destination)) { IBytesMessage message = session.CreateBytesMessage(); message.WriteBoolean(a); message.WriteByte(b); message.WriteChar(c); message.WriteInt16(d); message.WriteInt32(e); message.WriteInt64(f); message.WriteString(g); message.WriteBoolean(h); message.WriteByte(i); message.WriteInt16(j); message.WriteInt32(k); message.WriteInt64(l); message.WriteSingle(m); message.WriteDouble(n); producer.Send(message); message = consumer.Receive(receiveTimeout) as IBytesMessage; Assert.IsNotNull(message); Assert.IsTrue(((ActiveMQMessage)message).Compressed); Assert.AreEqual(a, message.ReadBoolean(), "Stream Boolean Value: a"); Assert.AreEqual(b, message.ReadByte(), "Stream Byte Value: b"); Assert.AreEqual(c, message.ReadChar(), "Stream Char Value: c"); Assert.AreEqual(d, message.ReadInt16(), "Stream Int16 Value: d"); Assert.AreEqual(e, message.ReadInt32(), "Stream Int32 Value: e"); Assert.AreEqual(f, message.ReadInt64(), "Stream Int64 Value: f"); Assert.AreEqual(g, message.ReadString(), "Stream String Value: g"); Assert.AreEqual(h, message.ReadBoolean(), "Stream Boolean Value: h"); Assert.AreEqual(i, message.ReadByte(), "Stream Byte Value: i"); Assert.AreEqual(j, message.ReadInt16(), "Stream Int16 Value: j"); Assert.AreEqual(k, message.ReadInt32(), "Stream Int32 Value: k"); Assert.AreEqual(l, message.ReadInt64(), "Stream Int64 Value: l"); Assert.AreEqual(m, message.ReadSingle(), "Stream Single Value: m"); Assert.AreEqual(n, message.ReadDouble(), "Stream Double Value: n"); } } } }
public long ReadInt64() { return(message.ReadInt64()); }