2121import static io .nats .client .Constants .ERR_TIMEOUT ;
2222import static io .nats .client .Constants .TLS_SCHEME ;
2323
24+ import io .nats .client .Constants .ConnState ;
25+
2426import org .slf4j .Logger ;
2527import org .slf4j .LoggerFactory ;
2628
5557import java .util .concurrent .locks .Lock ;
5658import java .util .concurrent .locks .ReentrantLock ;
5759
58- import io .nats .client .Constants .ConnState ;
59-
6060class ConnectionImpl implements Connection {
6161 final Logger logger = LoggerFactory .getLogger (ConnectionImpl .class );
6262
@@ -1994,16 +1994,10 @@ void _publish(byte[] subject, byte[] reply, byte[] data) throws IOException {
19941994 }
19951995 }
19961996
1997- // int pubProtoLen;
19981997 // write our pubProtoBuf buffer to the buffered writer.
19991998 try {
2000- // pubProtoLen = writePublishProto(pubProtoBuf, subject,
2001- // reply, msgSize);
20021999 writePublishProto (pubProtoBuf , subject , reply , msgSize );
20032000 } catch (BufferOverflowException e ) {
2004- // logger.trace("Overflowed buffer, buffer={}, subject.length={}, reply.length={}",
2005- // pubProtoBuf, subject.length, reply.length);
2006-
20072001 // We can get here if we have very large subjects.
20082002 // Expand with some room to spare.
20092003 int resizeAmount = Parser .MAX_CONTROL_LINE_SIZE + subject .length
@@ -2012,19 +2006,14 @@ void _publish(byte[] subject, byte[] reply, byte[] data) throws IOException {
20122006 buildPublishProtocolBuffer (resizeAmount );
20132007
20142008 writePublishProto (pubProtoBuf , subject , reply , msgSize );
2015-
2016- // pubProtoLen = writePublishProto(pubProtoBuf, subject,
2017- // reply, msgSize);
20182009 }
20192010
20202011 try {
20212012 bw .write (pubProtoBuf .array (), 0 , pubProtoBuf .position ());
20222013 pubProtoBuf .position (pubPrimBytesLen );
2023- logger .trace ("=> {}" , new String (pubProtoBuf .array ()).trim ());
20242014
20252015 if (msgSize > 0 ) {
20262016 bw .write (data , 0 , msgSize );
2027- // logger.trace("=> {}", new String(data, 0, msgSize).trim() );
20282017 }
20292018
20302019 bw .write (crlfProtoBytes , 0 , crlfProtoBytesLen );
@@ -2037,9 +2026,6 @@ void _publish(byte[] subject, byte[] reply, byte[] data) throws IOException {
20372026
20382027 stats .incrementOutMsgs ();
20392028 stats .incrementOutBytes (msgSize );
2040-
2041- // logger.trace("Successfully published to {}",
2042- // subject);
20432029 } finally {
20442030 mu .unlock ();
20452031 }
0 commit comments