Most folks want the opposite of what you're asking; they want to be able to read the content of the message on the web console. Therefore, if you build the message in such a way that the web console can deserialize it then the web console _will_ deserialize it. It will detect the BytesMessage and shove the underlying byte array into a String and give back the results. However, if you send an ObjectMessage there's very little chance it will be able to deserialize the actual object in the message.
That said, I agree with Tim that if the data really is sensitive then you should encrypt it in the sender and decrypt it in the receiver. Just obfuscating legitimately sensitive data is asking for trouble. Justin On Tue, Feb 1, 2022 at 7:54 AM Pattamadai, Sundar < [email protected]> wrote: > I understand. But I was wondering if web console can just show (or not > show) the raw binary content and serialization/deserialization happen only > on the client. That way the message content is not human readable in the > web console. I ran across IObjectMessage & CreateObjectMessage and tried > it. > > IObjectMessage objmsg = session.CreateObjectMessage(bytes); > producer.Send(objmsg, MsgDeliveryMode.Persistent, MsgPriority.Lowest, > TimeSpan.Zero); > > With this, I see that the webconsole's message details says " Cannot > display ObjectMessage body. Reason: Failed to build body from bytes. > Reason: java.io.StreamCorruptedException: invalid stream header: 00010000" > > But at the client I can still take the bytes and do what I need to. Yet > to fully vet this out. > > > > -----Original Message----- > From: Tim Bain <[email protected]> > Sent: Tuesday, February 1, 2022 7:38 AM > To: ActiveMQ Users <[email protected]> > Subject: Re: ActiveMQ Web Console - Prevent display of sensitive content? > > > ################################################################################################# > Warning: This email originated from outside of the Allscripts email > system. External Sender Address: users-return-54115-Sundar.Pattamadai= > [email protected] > > ################################################################################################# > > If you want to prevent messages from being read by people other than the > intended recipient, whether on the web console or elsewhere, the standard > way to do that is to encrypt the message when sending and then have the > intended recipient decrypt it upon receipt. > > Or you can limit access to the web console to only trusted admins who are > allowed to see these messages. > > Tim > > On Mon, Jan 31, 2022, 10:18 PM Pattamadai, Sundar < > [email protected]> wrote: > > > Hello, > > We binary serialize a C# object (which contains soap XML) and store it > > into a queue using ActiveMQBytesMessage class. (We are a .net/c# shop > > hence using activemq nms .net client against activemq 5.16.3) > > > > Snippet here as an example. > > > > byte[] msgBytes = payload.Content as byte[]; //payload is our C# > > object > > > > using (ISession session = connection.CreateSession()) { > > IMessageProducer prod = session.CreateProducer( > > new > > Apache.NMS.ActiveMQ.Commands.ActiveMQQueue(queueName)); > > ActiveMQBytesMessage aqbytes = new > ActiveMQBytesMessage(); > > aqbytes.Content = msgBytes; > > IMessage msg = aqbytes; > > msg.NMSDeliveryMode = MsgDeliveryMode.Persistent; > > prod.Send(msg); > > } > > > > Now in the ActiveMQ web console, when viewing the message, the message > > details box shows the bytes content mostly in plain text. We have some > > sensitive information we don't want it displayed in plain text. Are > > there any options in the web console to accomplish this? Or some other > approach? > > > > > > >
