You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by b4n4n4p4nd4 <ry...@gmail.com> on 2016/06/23 18:47:40 UTC

Difficulty porting example amqp/java publisher to new project

Basic assumption about production requirements... we're supposed to be able
to demonstrate that our project can send its messages out over amqp and have
them received by a broker on tomEE. As best we can tell this implies the
broker of choice is activemq and because of other requirements for being
able to show the same thing for websphere, we're assuming that the protocol
is amqp, and off we go clicking away.

Using apache-activemq-5.13.3-bin.zip, Windows 7, JVM 1.8 (but we can step
back to 1.7 if necessary), no server yet, just trying to send messages to a
broker on localhost.

Broker running from "%amqhome%\bin\activemq start"
Sample eclipse project created using examples\amqp\java\...\*.java

Dependencies for example project are:
activemq-all-5.13.3.jar
netty-all-4.0.21.Final.jar
proton-j-0.12.1.jar
qpid-jms-client-0.9.0.jar

Everything runs smoothly and with a couple minor tweaks to the loops, it
happily putters all day producing and consuming messages with the broker.
Even having twin publishers works fine without creating any apparent
conflict with the broker, and the listener is able to pick it all up.

Here's where I run into a problem:
I ported the content of the publisher's main method to my other project's
sendData method with the intention/belief that it would allow the messages
to start showing up upon being triggered by the other project. Same code,
same imports, same jars added to the classpath. It doesn't. It gets stuck on
the connection.start() line. No exceptions thrown.
I notice that the log output is different. We're both using slf4j. I strip
out activemq-all and replace it with activemq-client, activeio-core,
geronimo-jms_1.1_spec-1.1. The logging output returns to the way I had it,
but still no luck. It still hangs on connection.start().

Broker tends to spit this out:
 WARN | Transport Connection to: tcp://127.0.0.1:56966 failed:
org.apache.activemq.transport.InactivityIOException: Channel was inactive
for too (>30000) long: tcp://127.0.0.1:56966

Last thing I can print before the start command is the message, then netty
goes nutty with debug logging, and there's nothing to go on.

message-payload: blah blah blah
DEBUG [io.netty.util.internal.logging.InternalLoggerFactory debug]     Using
SLF4J as the default logging framework
DEBUG [io.netty.channel.MultithreadEventLoopGroup debug]              
-Dio.netty.eventLoopThreads: 16
DEBUG [io.netty.util.internal.PlatformDependent0 debug]               
java.nio.Buffer.address: available
DEBUG [io.netty.util.internal.PlatformDependent0 debug]               
sun.misc.Unsafe.theUnsafe: available
DEBUG [io.netty.util.internal.PlatformDependent0 debug]               
sun.misc.Unsafe.copyMemory: available
DEBUG [io.netty.util.internal.PlatformDependent0 debug]               
java.nio.Bits.unaligned: true
DEBUG [io.netty.util.internal.PlatformDependent debug]                
Platform: Windows
DEBUG [io.netty.util.internal.PlatformDependent debug]                 Java
version: 8
DEBUG [io.netty.util.internal.PlatformDependent debug]                
-Dio.netty.noUnsafe: false
DEBUG [io.netty.util.internal.PlatformDependent debug]                
sun.misc.Unsafe: available
DEBUG [io.netty.util.internal.PlatformDependent debug]                
-Dio.netty.noJavassist: false
DEBUG [io.netty.util.internal.PlatformDependent debug]                
Javassist: unavailable
DEBUG [io.netty.util.internal.PlatformDependent debug]                 You
don't have Javassist in your class path or you don't have enough permission
to load dynamically generated classes.  Please ch
eck the configuration for better performance.
DEBUG [io.netty.util.internal.PlatformDependent debug]                
-Dio.netty.tmpdir: C:\Users\admin\AppData\Local\Temp (java.io.tmpdir)
DEBUG [io.netty.util.internal.PlatformDependent debug]                
-Dio.netty.bitMode: 64 (sun.arch.data.model)
DEBUG [io.netty.util.internal.PlatformDependent debug]                
-Dio.netty.noPreferDirect: false
DEBUG [io.netty.channel.nio.NioEventLoop debug]                       
-Dio.netty.noKeySetOptimization: false
DEBUG [io.netty.channel.nio.NioEventLoop debug]                       
-Dio.netty.selectorAutoRebuildThreshold: 512
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.numHeapArenas: 4
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.numDirectArenas: 4
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.pageSize: 8192
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.maxOrder: 11
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.chunkSize: 16777216
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.tinyCacheSize: 512
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.smallCacheSize: 256
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.normalCacheSize: 64
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.maxCachedBufferCapacity: 32768
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]                  
-Dio.netty.allocator.cacheTrimInterval: 8192
DEBUG [io.netty.util.internal.ThreadLocalRandom debug]                
-Dio.netty.initialSeedUniquifier: 0x4d6129020e8123e5
DEBUG [io.netty.channel.ChannelOutboundBuffer debug]                  
-Dio.netty.threadLocalDirectBufferSize: 65536
DEBUG [io.netty.util.Recycler debug]                                  
-Dio.netty.recycler.maxCapacity.default: 262144
DEBUG [io.netty.buffer.ByteBufUtil debug]                             
-Dio.netty.allocator.type: unpooled
BEFORE START
DEBUG [io.netty.util.ResourceLeakDetector debug]                      
-Dio.netty.leakDetectionLevel: simple
DEBUG [org.apache.qpid.jms.provider.amqp.AmqpProvider run]            
Transport connection remotely closed

My absolute best guess is that somehow the other jars on the classpath are
interfering, or the command line and environment parameters between eclipse
vs. the project's launch bat are creating an obscure interference.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Difficulty-porting-example-amqp-java-publisher-to-new-project-tp4713289.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Difficulty porting example amqp/java publisher to new project

Posted by Tim Bain <tb...@alumni.duke.edu>.
If you take a thread dump after that last log line appears, where is it
stuck?  (Ideally post the full stack trace, if you can.)

Also, is your second producer running on the same machine?  Any chance the
host simply isn't reachable due to routing/firewall/etc?
On Jun 23, 2016 1:28 PM, "b4n4n4p4nd4" <ry...@gmail.com> wrote:

Basic assumption about production requirements... we're supposed to be able
to demonstrate that our project can send its messages out over amqp and have
them received by a broker on tomEE. As best we can tell this implies the
broker of choice is activemq and because of other requirements for being
able to show the same thing for websphere, we're assuming that the protocol
is amqp, and off we go clicking away.

Using apache-activemq-5.13.3-bin.zip, Windows 7, JVM 1.8 (but we can step
back to 1.7 if necessary), no server yet, just trying to send messages to a
broker on localhost.

Broker running from "%amqhome%\bin\activemq start"
Sample eclipse project created using examples\amqp\java\...\*.java

Dependencies for example project are:
activemq-all-5.13.3.jar
netty-all-4.0.21.Final.jar
proton-j-0.12.1.jar
qpid-jms-client-0.9.0.jar

Everything runs smoothly and with a couple minor tweaks to the loops, it
happily putters all day producing and consuming messages with the broker.
Even having twin publishers works fine without creating any apparent
conflict with the broker, and the listener is able to pick it all up.

Here's where I run into a problem:
I ported the content of the publisher's main method to my other project's
sendData method with the intention/belief that it would allow the messages
to start showing up upon being triggered by the other project. Same code,
same imports, same jars added to the classpath. It doesn't. It gets stuck on
the connection.start() line. No exceptions thrown.
I notice that the log output is different. We're both using slf4j. I strip
out activemq-all and replace it with activemq-client, activeio-core,
geronimo-jms_1.1_spec-1.1. The logging output returns to the way I had it,
but still no luck. It still hangs on connection.start().

Broker tends to spit this out:
 WARN | Transport Connection to: tcp://127.0.0.1:56966 failed:
org.apache.activemq.transport.InactivityIOException: Channel was inactive
for too (>30000) long: tcp://127.0.0.1:56966

Last thing I can print before the start command is the message, then netty
goes nutty with debug logging, and there's nothing to go on.

message-payload: blah blah blah
DEBUG [io.netty.util.internal.logging.InternalLoggerFactory debug]     Using
SLF4J as the default logging framework
DEBUG [io.netty.channel.MultithreadEventLoopGroup debug]
-Dio.netty.eventLoopThreads: 16
DEBUG [io.netty.util.internal.PlatformDependent0 debug]
java.nio.Buffer.address: available
DEBUG [io.netty.util.internal.PlatformDependent0 debug]
sun.misc.Unsafe.theUnsafe: available
DEBUG [io.netty.util.internal.PlatformDependent0 debug]
sun.misc.Unsafe.copyMemory: available
DEBUG [io.netty.util.internal.PlatformDependent0 debug]
java.nio.Bits.unaligned: true
DEBUG [io.netty.util.internal.PlatformDependent debug]
Platform: Windows
DEBUG [io.netty.util.internal.PlatformDependent debug]                 Java
version: 8
DEBUG [io.netty.util.internal.PlatformDependent debug]
-Dio.netty.noUnsafe: false
DEBUG [io.netty.util.internal.PlatformDependent debug]
sun.misc.Unsafe: available
DEBUG [io.netty.util.internal.PlatformDependent debug]
-Dio.netty.noJavassist: false
DEBUG [io.netty.util.internal.PlatformDependent debug]
Javassist: unavailable
DEBUG [io.netty.util.internal.PlatformDependent debug]                 You
don't have Javassist in your class path or you don't have enough permission
to load dynamically generated classes.  Please ch
eck the configuration for better performance.
DEBUG [io.netty.util.internal.PlatformDependent debug]
-Dio.netty.tmpdir: C:\Users\admin\AppData\Local\Temp (java.io.tmpdir)
DEBUG [io.netty.util.internal.PlatformDependent debug]
-Dio.netty.bitMode: 64 (sun.arch.data.model)
DEBUG [io.netty.util.internal.PlatformDependent debug]
-Dio.netty.noPreferDirect: false
DEBUG [io.netty.channel.nio.NioEventLoop debug]
-Dio.netty.noKeySetOptimization: false
DEBUG [io.netty.channel.nio.NioEventLoop debug]
-Dio.netty.selectorAutoRebuildThreshold: 512
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.numHeapArenas: 4
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.numDirectArenas: 4
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.pageSize: 8192
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.maxOrder: 11
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.chunkSize: 16777216
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.tinyCacheSize: 512
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.smallCacheSize: 256
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.normalCacheSize: 64
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.maxCachedBufferCapacity: 32768
DEBUG [io.netty.buffer.PooledByteBufAllocator debug]
-Dio.netty.allocator.cacheTrimInterval: 8192
DEBUG [io.netty.util.internal.ThreadLocalRandom debug]
-Dio.netty.initialSeedUniquifier: 0x4d6129020e8123e5
DEBUG [io.netty.channel.ChannelOutboundBuffer debug]
-Dio.netty.threadLocalDirectBufferSize: 65536
DEBUG [io.netty.util.Recycler debug]
-Dio.netty.recycler.maxCapacity.default: 262144
DEBUG [io.netty.buffer.ByteBufUtil debug]
-Dio.netty.allocator.type: unpooled
BEFORE START
DEBUG [io.netty.util.ResourceLeakDetector debug]
-Dio.netty.leakDetectionLevel: simple
DEBUG [org.apache.qpid.jms.provider.amqp.AmqpProvider run]
Transport connection remotely closed

My absolute best guess is that somehow the other jars on the classpath are
interfering, or the command line and environment parameters between eclipse
vs. the project's launch bat are creating an obscure interference.



--
View this message in context:
http://activemq.2283324.n4.nabble.com/Difficulty-porting-example-amqp-java-publisher-to-new-project-tp4713289.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.