Rajith Attapattu wrote:
Hi Folks,

I believe there is some unnecessary message duplication logic in the java
client code, which resolved properly could improve performance in high
volume scenarios.

The sendImpl() in the BasicMessageProducer calls a method called
convertToNativeMessage() which is called every time.

[...]

This method should be invoked selectively.
A check like if originalMsg instanceof
org.apache.qpid.client.message.AMQMessage, then skip
convertToNativeMessage() should be employed.

You mean something like this (taken from the current trunk!):

private AbstractJMSMessage convertToNativeMessage(Message message) throws JMSException
    {
        if (message instanceof AbstractJMSMessage)
        {
            return (AbstractJMSMessage) message;
        }
        else
        {
            AbstractJMSMessage newMessage;

            if (message instanceof BytesMessage)
            {
newMessage = new MessageConverter((BytesMessage)message).getConvertedMessage();
            }
            else if (message instanceof MapMessage)
            {

In other words the check is already there, its just in the convert method itself.

Reply via email to