[ 
https://issues.apache.org/jira/browse/PROTON-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13921324#comment-13921324
 ] 

Marcel Meulemans edited comment on PROTON-528 at 3/5/14 8:00 PM:
-----------------------------------------------------------------

This patch fixes the issue:

Increased the max channels of the java connection implementation to 65535. AMQP 
1.0 specifies 2 bytes for the channel number but the java implementation only 
uses the lower byte. The implementation matches the C implementation (including 
the channel number allocation code which is not optimal).



was (Author: mmeulemans):
This patch fixes the issue.

> Incorrect limit for the channel number.
> ---------------------------------------
>
>                 Key: PROTON-528
>                 URL: https://issues.apache.org/jira/browse/PROTON-528
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-j
>    Affects Versions: 0.7
>            Reporter: Marcel Meulemans
>            Priority: Minor
>         Attachments: proton.patch
>
>
> AMQP 1.0 specifies 2 bytes for the channel number but the java implementation 
> only uses the lower byte (proton-c uses both). The following code shows the 
> issues when used together with the c recv example. The loop will hang after 
> sending 256 messages.
> import java.io.IOException;
> import org.apache.qpid.proton.messenger.Messenger;
> import org.apache.qpid.proton.messenger.impl.MessengerImpl;
> import org.apache.qpid.proton.message.Message;
> import org.apache.qpid.proton.message.impl.MessageImpl;
> import org.apache.qpid.proton.amqp.messaging.AmqpValue;
> public class ProtonTest
> {
>       public static void main(String[] args)
>       {
>               Messenger messenger = new MessengerImpl();
>               try
>               {
>                       messenger.start();
>                       for (int i = 0; i < 257; i++)
>                       {
>                           Message message = new MessageImpl();
>                           
> message.setAddress(String.format("amqp://localhost:5672/queue://receiver%03d",
>  i));
>                           message.setBody(new AmqpValue("message " + i));     
>               
>                           messenger.put(message);
>                           messenger.send();
>                           System.out.println("Send message " + i);
>                       }        
>                       messenger.stop();
>               }
>               catch (IOException e)
>               {
>                       e.printStackTrace();
>               }
>       }
> }



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to