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

ASF GitHub Bot commented on ARTEMIS-1656:
-----------------------------------------

Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1849#discussion_r165900265
  
    --- Diff: 
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
 ---
    @@ -430,24 +442,29 @@ private void callFailureListeners(final 
ActiveMQException me) {
     
        // send a WireFormatInfo to the peer
        public void sendHandshake() {
    -      WireFormatInfo info = wireFormat.getPreferedWireFormatInfo();
    +      WireFormatInfo info = inWireFormat.getPreferedWireFormatInfo();
           sendCommand(info);
        }
     
        public ConnectionState getState() {
           return state;
        }
     
    +   private static void tracePhysicalSend(Connection transportConnection, 
Command command) {
    +      logger.trace("connectionID: " + (transportConnection == null ? "" : 
transportConnection.getID()) + " SENDING: " + (command == null ? "NULL" : 
command));
    +   }
    +
        public void physicalSend(Command command) throws IOException {
     
           if (logger.isTraceEnabled()) {
    -         logger.trace("connectionID: " + (getTransportConnection() == null 
? "" : getTransportConnection().getID())
    -                         + " SENDING: " + (command == null ? "NULL" : 
command));
    +         tracePhysicalSend(transportConnection, command);
           }
     
           try {
    -         ByteSequence bytes = wireFormat.marshal(command);
    -         ActiveMQBuffer buffer = OpenWireUtil.toActiveMQBuffer(bytes);
    +         final ByteSequence bytes = outWireFormat.marshal(command);
    +         final int bufferSize = bytes.length;
    +         final ActiveMQBuffer buffer = 
transportConnection.createTransportBuffer(bufferSize);
    --- End diff --
    
    should this be getTransportConnection, like the existing code below, or 
should the existing code below use the field directly also. Just a consistency 
POV. 


> OpenWire scalability improvements
> ---------------------------------
>
>                 Key: ARTEMIS-1656
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1656
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>            Priority: Minor
>
> OpenWire is using the synchronized OpenWireFormat instance belonging to 
> OpenWireProtocolManager: it won't allow to scale with the number of 
> connections.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to