You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jason P <co...@yahoo.com> on 2006/04/14 21:50:37 UTC

Setting SSL timeout value

Is there an easy way to set the SSL timeout value used by the Transport
classes?  I have a client application that can connect up via SSL fine
unless it runs on a slow machine.  I set javax.net.debug=all and can see
that on the SSL connection that fails the timeout value is getting set to
500 ms:

sslsocket: SSLSocket.setSoTimeout()
sslsocket: timeout = 500           

Here as a trace excerpt from my client application.  Anything prefixed with
a "PT:" is a log statement I added to the ActiveMQ source.  The second
sslsocket: timeout value listed is the one I'm concerned with (it should be
in bold):

04/14/06 11:37:12.844 DEBUG [Thread-0] - Creating ActiveMQConnectionFactory
using URL: ssl://10.0.1.9:3066
04/14/06 11:37:13.568 DEBUG [Thread-0] - Creating ActiveMQ Connection.
04/14/06 11:37:13.573 DEBUG [Thread-0] - PT: Enter
ActiveMQConnectionFactory.createActiveMQConnection()
04/14/06 11:37:13.574 DEBUG [Thread-0] - PT: Creating Transport instance by
using TransportFactory to connect to broker URL "ssl://10.0.1.9:3066".
04/14/06 11:37:13.805 DEBUG [Thread-0] - PT: Enter
TransportFactory.connect(URI location, Executor ex)
04/14/06 11:37:13.813 DEBUG [Thread-0] - PT: Enter
TransportFactory.findTransportFactory(URI location)
04/14/06 11:37:13.814 DEBUG [Thread-0] - PT: Getting Scheme from
locationURI: ssl://10.0.1.9:3066
04/14/06 11:37:13.815 DEBUG [Thread-0] - PT: Getting TransportFactory for
scheme "ssl".
04/14/06 11:37:13.816 DEBUG [Thread-0] - PT: TransportFactory is null.
04/14/06 11:37:13.817 DEBUG [Thread-0] - PT: Attempting to create new
TransportFactory for scheme "ssl".
04/14/06 11:37:14.005 DEBUG [Thread-0] - PT: Adding newly created
TransportFactory to TransportFactory list.
04/14/06 11:37:14.013 DEBUG [Thread-0] - PT: Returning TransportFactroy for
scheme "ssl".
04/14/06 11:37:14.014 DEBUG [Thread-0] - PT: Leave
TransportFactory.findTransportFactory(URI location)
04/14/06 11:37:14.015 DEBUG [Thread-0] - PT: Leave
TransportFactory.connect(URI location, Executor ex)
04/14/06 11:37:14.016 DEBUG [Thread-0] - PT: Enter
TransportFactory.createWireFormat(Map options)
04/14/06 11:37:14.022 DEBUG [Thread-0] - PT: Creating WireFormatFactory.
04/14/06 11:37:14.026 DEBUG [Thread-0] - PT: Enter
TransportFactory.createWireFormatFactory(Map options)
04/14/06 11:37:14.027 DEBUG [Thread-0] - PT: WireFormat not specified in
options.
04/14/06 11:37:14.033 DEBUG [Thread-0] - PT: Getting default WireFormat.
04/14/06 11:37:14.033 DEBUG [Thread-0] - PT: Creating new WireFormatFactory
instance for WireFormat "default".
04/14/06 11:37:14.073 DEBUG [Thread-0] - PT: Setting properties of
IntrospectionSupport.
04/14/06 11:37:14.103 DEBUG [Thread-0] - PT: Leave
TransportFactory.createWireFormatFactory(Map options)
04/14/06 11:37:14.106 DEBUG [Thread-0] - PT: Creating WireFormat.
04/14/06 11:37:14.986 DEBUG [Thread-0] - PT: Leave
TransportFactory.createWireFormat(Map options)
sslctx: Context created.
sslctx: Supported protocols:
{
SSLv2
SSLv3
TLSv1
}
sslctx: Supported cipher suites:
{
SSL_RSA_WITH_RC4_128_MD5
SSL_RSA_WITH_RC4_128_SHA
SSL_RSA_WITH_AES_CBC_128_SHA
SSL_RSA_WITH_AES_CBC_256_SHA
SSL_RSA_WITH_3DES_EDE_CBC_SHA
SSL_RSA_WITH_DES_CBC_SHA
SSL_RSA_WITH_DES_CBC_MD5
SSL_RSA_WITH_3DES_EDE_CBC_MD5
SSL_RSA_WITH_RC2_CBC_128_MD5
SSL_RSA_EXPORT_WITH_RC4_40_MD5
SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
SSL_RSA_WITH_NULL_MD5
SSL_RSA_WITH_NULL_SHA
}
sslctx: Default cipher suites:
{
SSL_RSA_WITH_RC4_128_MD5
SSL_RSA_WITH_RC4_128_SHA
SSL_RSA_WITH_AES_CBC_128_SHA
SSL_RSA_WITH_AES_CBC_256_SHA
SSL_RSA_WITH_3DES_EDE_CBC_SHA
SSL_RSA_WITH_DES_CBC_SHA
SSL_RSA_WITH_DES_CBC_MD5
SSL_RSA_WITH_3DES_EDE_CBC_MD5
SSL_RSA_WITH_RC2_CBC_128_MD5
SSL_RSA_EXPORT_WITH_RC4_40_MD5
SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
}
sslctx: SSLContext.init()
sslctx: KeyManager[0] class = com.ibm.jsse.bg
sslctx: TrustManager[0] class = com.ibm.jsse.bi
sslctx: SSLContext.getSocketFactory()
socketfactory: Socket factory created.
socketfactory: SSLSocketFactory.createSocket()
socketfactory: host = 10.0.1.9
socketfactory: port = 3066
sslsocket: SSL Socket created.
sslsocket: host = 10.0.1.9
sslsocket: port = 3066
sslctx: SSLContextImpl.isInitialized()
sslctx: SSLContextImpl.initialize()
sslctx: SSLConfiguration = null
sslctx: SSLContextImpl.getCertifcateChainAlias()
sslctx: Certificate authorities list = null
sslctx: Server = true
sslctx: SSLContextImpl.getCertificateChain()
sslctx: Alias = compliancemonitor
sslctx: SSLContextImpl.getPrivateKey()
sslctx: Alias = compliancemonitor
sslctx: SSLContextImpl.getDefaultCipherSuites()
sslctx: SSLContextImpl.getSupportedProtocols()
sslsocket: SSLSocket.setEnabledProtocols()
sslsocket: protocols =
{
SSLv2
SSLv3
TLSv1
}
sslctx: SSLContextImpl.validateProtocols()    
sslctx: Protocols:
{
SSLv2
SSLv3
TLSv1
}
sslsocket: SSLSocketImpl.init()
sslsocket: roleIsServer = false
sslsocket: enabledCipherSuites =
{
SSL_RSA_WITH_RC4_128_MD5
SSL_RSA_WITH_RC4_128_SHA
SSL_RSA_WITH_AES_CBC_128_SHA
SSL_RSA_WITH_AES_CBC_256_SHA
SSL_RSA_WITH_3DES_EDE_CBC_SHA
SSL_RSA_WITH_DES_CBC_SHA
SSL_RSA_WITH_DES_CBC_MD5
SSL_RSA_WITH_3DES_EDE_CBC_MD5
SSL_RSA_WITH_RC2_CBC_128_MD5
SSL_RSA_EXPORT_WITH_RC4_40_MD5
SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
}
sslsocket: enabledProtocols =
{
SSLv2                                
SSLv3
TLSv1
}
sslsocket: SSLSocket.connect()
sslsocket: endpoint = /10.0.1.9:3066
sslsocket: timeout = 0
sslsocket: SSLSocket.isClosed()
sslsocket: SSLSocket.isConnected()
sslsocket: SSLSocket.getInputStream()
sslsocket: SSLSocket.isClosed()
sslinput: Input stream created.
sslsess: SSLSession.getCipherSuite()
sslsess: cipherSuite = SSL_NULL_WITH_NULL_NULL
sslsocket: SSLSocket.isConnected()
sslinput: conn = [SSL_NULL_WITH_NULL_NULL:
Socket[addr=10.0.1.9/10.0.1.9,port=3066,localport=9196]] 
sslsocket: SSLSocket.getOutputStream()
sslsocket: SSLSocket.isClosed()
ssloutput: Output stream created.
sslsess: SSLSession.getCipherSuite()
sslsess: cipherSuite = SSL_NULL_WITH_NULL_NULL
sslsocket: SSLSocket.isConnected()
ssloutput: conn = [SSL_NULL_WITH_NULL_NULL:
Socket[addr=10.0.1.9/10.0.1.9,port=3066,localport=9196]]
sslsocket: SSLSocket.setReceiveBufferSize()
sslsocket: size = 65536
sslsocket: SSLSocket.isClosed()
sslsocket: SSLSocket.setSendBufferSize()
sslsocket: size = 65536
sslsocket: SSLSocket.isClosed()
04/14/06 11:37:16.273 DEBUG [Thread-0] - PT: Creating ActiveMQConnection
using Transport instance and Factory Stats stats{ unit: 
many startTime: 1145039833545 lastSampleTime: 1145039833545 description:
Used only as container, not Statistic }
04/14/06 11:37:16.613 DEBUG [Thread-0] - PT: Setting connection username:
jasonp
04/14/06 11:37:16.614 DEBUG [Thread-0] - PT: Setting connection password.
04/14/06 11:37:16.615 DEBUG [Thread-0] - PT: Setting connection
PrefetchPolicy: org.apache.activemq.ActiveMQPrefetchPolicy@7bdb42d8
04/14/06 11:37:16.616 DEBUG [Thread-0] - PT: Setting connection
DisableTimeStampsByDefault: false
04/14/06 11:37:16.617 DEBUG [Thread-0] - PT: Setting connection
OnSendPrepareMessageBody: true
04/14/06 11:37:16.623 DEBUG [Thread-0] - PT: Setting connection
OptimizedMessageDispatch: true
04/14/06 11:37:16.624 DEBUG [Thread-0] - PT: Setting connection
CopyMessageOnSend: true
04/14/06 11:37:16.625 DEBUG [Thread-0] - PT: Setting connection
UseCompression: false
04/14/06 11:37:16.626 DEBUG [Thread-0] - PT: Setting connection
ObjectMessageSerializationDefered: false
04/14/06 11:37:16.627 DEBUG [Thread-0] - PT: Setting connection
AsyncDispatch: true
04/14/06 11:37:16.633 DEBUG [Thread-0] - PT: Setting connection
UseAsyncSend: false
04/14/06 11:37:16.634 DEBUG [Thread-0] - PT: Setting connection
UseRetroactiveConsumer: false
04/14/06 11:37:16.635 DEBUG [Thread-0] - PT: Setting connection
RedeliveryPolicy: org.apache.activemq.RedeliveryPolicy@7bdb42a8
04/14/06 11:37:16.636 DEBUG [Thread-0] - PT: Starting Transport.
04/14/06 11:37:16.637 DEBUG [Thread-0] - PT: Transport Class: class
org.apache.activemq.transport.ResponseCorrelator
sslsocket: SSLSocket.isBound()
sslsocket: SSLSocket.getLocalAddress()
sslsocket: SSLSocket.isBound()
ssloutput: SSLOutputStream.write()
ssloutput: data =
Invalid buffer
sslsocket: SSLSocketImpl.write()
sslsocket: len = 22
sslsocket: SSLSocket.startHandshake()
sslsocket: SSLSocket.isClosed()
sslsocket: SSLServerSocket.getLocalPort()
sslsocket: SSLSocket.isBound()
sslsocket: SSLSocket.isConnected()
sslsocket: SSLServerSocket.getInetAddress()
sslsocket: SSLSocket.isConnected()
sslsocket: SSLServerSocket.getPort()
sslsocket: SSLSocket.isConnected()
sslsocket: SSLSocket.setSoTimeout()
sslsocket: timeout = 500
sslctx: SSLContextImpl.validateCertificateChain()
sslctx: Certificate chain = [[B@33b085fb
sslctx: Certificate[0] = [B@121efcdf
sslctx: Server = false
sslsocket: SSLServerSocket.getHost()
sslsess: Session created.
04/14/06 11:37:16.896 DEBUG [Thread-0] - Leave
ActiveMQConnectionFactory.createActiveMQConnection() 
04/14/06 11:37:16.897 DEBUG [Thread-0] - Registering as an ExceptionListener
for ActiveMQConnection.
04/14/06 11:37:16.902 DEBUG [Thread-0] - Starting ActiveMQ Connection.
sslsocket: SSLSocket.isClosed()
sslinput: SSLInputStream.read()
sslinput: off = 0
sslinput: len = 65536
sslsocket: SSLSocketImpl.read()
sslsocket: off = 0
sslsocket: len = 65536
sslinput: data =
Invalid buffer
sslinput: rc = 22
04/14/06 11:37:16.940 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT: WireFormatInfo:
04/14/06 11:37:16.946 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   CommandId: 0
04/14/06 11:37:16.947 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   Options: 5
04/14/06 11:37:16.948 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   Version: 1
04/14/06 11:37:16.949 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   DataStructureType: 1
04/14/06 11:37:16.950 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   Magic: [B@4bd53392
04/14/06 11:37:16.953 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isBrokerInfo: false
04/14/06 11:37:16.954 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isCacheEnabled: true
04/14/06 11:37:16.955 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isMarshallAware: false
04/14/06 11:37:16.956 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isMessage: false
04/14/06 11:37:16.956 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isMessageAck: false
04/14/06 11:37:16.963 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isMessageDispatch: false
04/14/06 11:37:16.964 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isMessageDispatchNotification: false
04/14/06 11:37:16.964 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isResponse: false
04/14/06 11:37:16.965 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isResponseRequired: false
04/14/06 11:37:16.966 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isShutdownInfo: false
04/14/06 11:37:16.967 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isStackTraceEnabled: true
04/14/06 11:37:16.973 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isTcpNoDelay: false
04/14/06 11:37:16.974 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isValid: true
04/14/06 11:37:16.975 DEBUG [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - PT:   isWireFormatInfo: true
sslinput: SSLInputStream.read()
sslinput: off = 22
sslinput: len = 65514
ssloutput: SSLOutputStream.write()
ssloutput: data =
Invalid buffer
sslsocket: SSLSocketImpl.write()
sslsocket: len = 126
sslsocket: SSLSocketImpl.read()
sslsocket: off = 22
sslsocket: len = 65514
sslinput: data = 
   N  Þ     |  ID:Jasonp-2266-1145033060140-0:0  ssl://localhost:3066          
localhost
sslinput: rc = 82
sslinput: SSLInputStream.read()
sslinput: off = 104
sslinput: len = 65432
sslsocket: SSLSocketImpl.read()
sslsocket: off = 104
sslsocket: len = 65432
04/14/06 11:37:17.554 ERROR [Socket Connection: /10.0.1.178:9196 ->
10.0.1.9/10.0.1.9:3066] - ActiveMQ JMS Exception occured.
javax.jms.JMSException: Read timed out
        at java.lang.Throwable.<init>(Throwable.java:195)
        at java.lang.Exception.<init>(Exception.java:41)
        at javax.jms.JMSException.<init>(JMSException.java:35)
        at javax.jms.JMSException.<init>(JMSException.java:41)
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:45)
        at
org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1327)
        at
org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:1337)
        at
org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:102)
        at
org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:102)
        at
org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:102)
        at
org.apache.activemq.transport.InactivityMonitor.onException(InactivityMonitor.java:96)
        at
org.apache.activemq.transport.activeio.ActiveIOTransport$1.onError(ActiveIOTransport.java:100)
        at
org.activeio.command.AsyncChannelToAsyncCommandChannel$1.onPacketError(AsyncChannelToAsyncCommandChannel.java:78)
        at
org.activeio.FilterAsyncChannel.onPacketError(FilterAsyncChannel.java:94)
        at
org.activeio.FilterAsyncChannel.onPacketError(FilterAsyncChannel.java:94)
        at
org.activeio.adapter.SyncToAsyncChannel.run(SyncToAsyncChannel.java:159)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.InterruptedIOException: Read timed out
        at java.lang.Throwable.<init>(Throwable.java:195)
        at java.lang.Exception.<init>(Exception.java:41)
        at java.io.IOException.<init>(IOException.java:40)
        at
java.io.InterruptedIOException.<init>(InterruptedIOException.java:45) 
        at
com.ibm.as400.ibmonly.net.ssl.SSLSocketImpl.read(SSLSocketImpl.java:652)
        at
com.ibm.as400.ibmonly.net.ssl.SSLInputStream.read(SSLInputStream.java:133)
        at
org.activeio.net.SocketStreamChannel.read(SocketStreamChannel.java:208)
        at
org.activeio.net.SocketSyncChannel.read(SocketSyncChannel.java:79)
        at
org.activeio.adapter.SyncToAsyncChannel.run(SyncToAsyncChannel.java:145)
        ... 3 more                                                                   
ssloutput: SSLOutputStream.close()
sslsocket: SSLServerSocket.close()
sslsocket: SSLSocket.isClosed()
sslinput: SSLInputStream.close()
sslsocket: SSLServerSocket.close()
sslsocket: SSLServerSocket.close()


--
View this message in context: http://www.nabble.com/Setting-SSL-timeout-value-t1451458.html#a3922290
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Setting SSL timeout value

Posted by James Strachan <ja...@gmail.com>.
Great - thanks for letting us know.

On 4/20/06, Jason P <co...@yahoo.com> wrote:
>
> Just an update for anyone following the thread.  I downloaded the latest
> SNAPSHOT source, compiled it and ran the same scenario again using the new
> jars.  Everything worked fine, even without modifying the soTimeout value in
> the URI.  I'll make sure I grab the latest SNAPSHOT the next time I run into
> anything.
>
> Thanks again James for the help,
> Jason
> --
> View this message in context: http://www.nabble.com/Setting-SSL-timeout-value-t1451458.html#a4010185
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/

Re: Setting SSL timeout value

Posted by Jason P <co...@yahoo.com>.
Just an update for anyone following the thread.  I downloaded the latest
SNAPSHOT source, compiled it and ran the same scenario again using the new
jars.  Everything worked fine, even without modifying the soTimeout value in
the URI.  I'll make sure I grab the latest SNAPSHOT the next time I run into
anything.

Thanks again James for the help,
Jason
--
View this message in context: http://www.nabble.com/Setting-SSL-timeout-value-t1451458.html#a4010185
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Setting SSL timeout value

Posted by Jason P <co...@yahoo.com>.
Thanks James!

I'll download the latest source snapshot and give it a try today.

Jason
--
View this message in context: http://www.nabble.com/Setting-SSL-timeout-value-t1451458.html#a3989990
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Setting SSL timeout value

Posted by James Strachan <ja...@gmail.com>.
BTW I could tell this as the 'ssl' transport no longer uses ActiveIO...

java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:36)
       at
org.apache.activemq.transport.activeio.ActiveIOTransportFactory.doConnect(ActiveIOTransportFactory.java:76)


On 4/18/06, James Strachan <ja...@gmail.com> wrote:
> Ah - I think the TCP connection parameters only work with fairly
> recent releases of ActiveMQ; e.g. it should work if you try 4.0-RC3
>
> On 4/18/06, Jason P <co...@yahoo.com> wrote:
> >
> > Thanks for the reply James,
> >
> > I took a look at the TCP Transport Reference and modified my code to include
> > the timeout parameter but now I'm getting some exceptions during the
> > connection attempt.  When I add in the soTimeout Transport Option I get the
> > following error:
> >
> > javax.jms.JMSException: Could not connect to broker URL:
> > ssl://10.0.1.9:3066?soTimeout=9000. Reason:
> > java.lang.IllegalArgumentException: Invalid connect parameters:
> > {soTimeout=9000}
> >         at java.lang.Throwable.<init>(Throwable.java:195)
> >         at java.lang.Exception.<init>(Exception.java:41)
> >         at javax.jms.JMSException.<init>(JMSException.java:35)
> >         at javax.jms.JMSException.<init>(JMSException.java:41)
> >         at
> > org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:32)
> >         at
> > org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
> >         at
> > org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:155)
> >         ... 3 more
> > Caused by: java.lang.IllegalArgumentException: Invalid connect parameters:
> > {soTimeout=9000}
> >         at java.lang.Throwable.<init>(Throwable.java:195)
> >         at java.lang.Exception.<init>(Exception.java:41)
> >         at java.lang.RuntimeException.<init>(RuntimeException.java:43)
> >         at
> > java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:36)
> >         at
> > org.apache.activemq.transport.activeio.ActiveIOTransportFactory.doConnect(ActiveIOTransportFactory.java:76)
> >         at
> > org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:84)
> >         at
> > org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:210)
> >         ... 5 more
> >
> > I then tried to connect using the connectionTimeout Transport Option and
> > received a similar exception:
> >
> > javax.jms.JMSException: Could not connect to broker URL:
> > ssl://10.0.1.9:3066?connectionTimeout=9000. Reason:
> > java.lang.IllegalArgumentException: Invalid connect parameters:
> > {connectionTimeout=9000}
> >         at java.lang.Throwable.<init>(Throwable.java:195)
> >         at java.lang.Exception.<init>(Exception.java:41)
> >         at javax.jms.JMSException.<init>(JMSException.java:35)
> >         at javax.jms.JMSException.<init>(JMSException.java:41)
> >         at
> > org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:32)
> >         at
> > org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
> >         at
> > org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:155)
> >         at
> > com.powertech.cm.qcom.client.CMRequestSender.connect(CMRequestSender.java:210)
> >         at
> > com.powertech.cm.qcom.client.CMClientCommunicator.init(CMClientCommunicator.java:225)
> >         at
> > com.powertech.cm.qcom.client.CMClientCommunicator.<init>(CMClientCommunicator.java:187)
> >         at
> > com.powertech.cm.qcom.client.CMClientCommunicator.main(CMClientCommunicator.java:4355)
> >  Caused by: java.lang.IllegalArgumentException: Invalid connect parameters:
> > {connectionTimeout=9000}
> >         at java.lang.Throwable.<init>(Throwable.java:195)
> >         at java.lang.Exception.<init>(Exception.java:41)
> >         at java.lang.RuntimeException.<init>(RuntimeException.java:43)
> >         at
> > java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:36)
> >         at
> > org.apache.activemq.transport.activeio.ActiveIOTransportFactory.doConnect(ActiveIOTransportFactory.java:76)
> >         at
> > org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:84)
> >         at
> > org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:210)
> >         ... 5 more
> >
> > I'm using the ActiveMQ 4.0-M4 source download which I modified in Eclipse
> > and built using Maven (maven -Dmaven.test.skip=true).  Do the Transport
> > Options remain the same from 3.x to 4.x?
> >
> >
> >
> > --
> > View this message in context: http://www.nabble.com/Setting-SSL-timeout-value-t1451458.html#a3971182
> > Sent from the ActiveMQ - User forum at Nabble.com.
> >
> >
>
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


--

James
-------
http://radio.weblogs.com/0112098/

Re: Setting SSL timeout value

Posted by James Strachan <ja...@gmail.com>.
Ah - I think the TCP connection parameters only work with fairly
recent releases of ActiveMQ; e.g. it should work if you try 4.0-RC3

On 4/18/06, Jason P <co...@yahoo.com> wrote:
>
> Thanks for the reply James,
>
> I took a look at the TCP Transport Reference and modified my code to include
> the timeout parameter but now I'm getting some exceptions during the
> connection attempt.  When I add in the soTimeout Transport Option I get the
> following error:
>
> javax.jms.JMSException: Could not connect to broker URL:
> ssl://10.0.1.9:3066?soTimeout=9000. Reason:
> java.lang.IllegalArgumentException: Invalid connect parameters:
> {soTimeout=9000}
>         at java.lang.Throwable.<init>(Throwable.java:195)
>         at java.lang.Exception.<init>(Exception.java:41)
>         at javax.jms.JMSException.<init>(JMSException.java:35)
>         at javax.jms.JMSException.<init>(JMSException.java:41)
>         at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:32)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:155)
>         ... 3 more
> Caused by: java.lang.IllegalArgumentException: Invalid connect parameters:
> {soTimeout=9000}
>         at java.lang.Throwable.<init>(Throwable.java:195)
>         at java.lang.Exception.<init>(Exception.java:41)
>         at java.lang.RuntimeException.<init>(RuntimeException.java:43)
>         at
> java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:36)
>         at
> org.apache.activemq.transport.activeio.ActiveIOTransportFactory.doConnect(ActiveIOTransportFactory.java:76)
>         at
> org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:84)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:210)
>         ... 5 more
>
> I then tried to connect using the connectionTimeout Transport Option and
> received a similar exception:
>
> javax.jms.JMSException: Could not connect to broker URL:
> ssl://10.0.1.9:3066?connectionTimeout=9000. Reason:
> java.lang.IllegalArgumentException: Invalid connect parameters:
> {connectionTimeout=9000}
>         at java.lang.Throwable.<init>(Throwable.java:195)
>         at java.lang.Exception.<init>(Exception.java:41)
>         at javax.jms.JMSException.<init>(JMSException.java:35)
>         at javax.jms.JMSException.<init>(JMSException.java:41)
>         at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:32)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:155)
>         at
> com.powertech.cm.qcom.client.CMRequestSender.connect(CMRequestSender.java:210)
>         at
> com.powertech.cm.qcom.client.CMClientCommunicator.init(CMClientCommunicator.java:225)
>         at
> com.powertech.cm.qcom.client.CMClientCommunicator.<init>(CMClientCommunicator.java:187)
>         at
> com.powertech.cm.qcom.client.CMClientCommunicator.main(CMClientCommunicator.java:4355)
>  Caused by: java.lang.IllegalArgumentException: Invalid connect parameters:
> {connectionTimeout=9000}
>         at java.lang.Throwable.<init>(Throwable.java:195)
>         at java.lang.Exception.<init>(Exception.java:41)
>         at java.lang.RuntimeException.<init>(RuntimeException.java:43)
>         at
> java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:36)
>         at
> org.apache.activemq.transport.activeio.ActiveIOTransportFactory.doConnect(ActiveIOTransportFactory.java:76)
>         at
> org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:84)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:210)
>         ... 5 more
>
> I'm using the ActiveMQ 4.0-M4 source download which I modified in Eclipse
> and built using Maven (maven -Dmaven.test.skip=true).  Do the Transport
> Options remain the same from 3.x to 4.x?
>
>
>
> --
> View this message in context: http://www.nabble.com/Setting-SSL-timeout-value-t1451458.html#a3971182
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/

Re: Setting SSL timeout value

Posted by Jason P <co...@yahoo.com>.
Thanks for the reply James,

I took a look at the TCP Transport Reference and modified my code to include
the timeout parameter but now I'm getting some exceptions during the
connection attempt.  When I add in the soTimeout Transport Option I get the
following error:

javax.jms.JMSException: Could not connect to broker URL:
ssl://10.0.1.9:3066?soTimeout=9000. Reason:
java.lang.IllegalArgumentException: Invalid connect parameters:
{soTimeout=9000}
        at java.lang.Throwable.<init>(Throwable.java:195)
        at java.lang.Exception.<init>(Exception.java:41)
        at javax.jms.JMSException.<init>(JMSException.java:35)
        at javax.jms.JMSException.<init>(JMSException.java:41)
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:32)
        at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
        at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:155)
        ... 3 more
Caused by: java.lang.IllegalArgumentException: Invalid connect parameters:
{soTimeout=9000}                           
        at java.lang.Throwable.<init>(Throwable.java:195)
        at java.lang.Exception.<init>(Exception.java:41)
        at java.lang.RuntimeException.<init>(RuntimeException.java:43)
        at
java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:36)
        at
org.apache.activemq.transport.activeio.ActiveIOTransportFactory.doConnect(ActiveIOTransportFactory.java:76)
        at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:84)
        at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:210) 
        ... 5 more

I then tried to connect using the connectionTimeout Transport Option and
received a similar exception:

javax.jms.JMSException: Could not connect to broker URL:
ssl://10.0.1.9:3066?connectionTimeout=9000. Reason:
java.lang.IllegalArgumentException: Invalid connect parameters:
{connectionTimeout=9000}
        at java.lang.Throwable.<init>(Throwable.java:195)
        at java.lang.Exception.<init>(Exception.java:41)
        at javax.jms.JMSException.<init>(JMSException.java:35)
        at javax.jms.JMSException.<init>(JMSException.java:41)
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:32)
        at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:258)
        at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:155)
        at
com.powertech.cm.qcom.client.CMRequestSender.connect(CMRequestSender.java:210)
        at
com.powertech.cm.qcom.client.CMClientCommunicator.init(CMClientCommunicator.java:225)
        at
com.powertech.cm.qcom.client.CMClientCommunicator.<init>(CMClientCommunicator.java:187)
        at
com.powertech.cm.qcom.client.CMClientCommunicator.main(CMClientCommunicator.java:4355)
 Caused by: java.lang.IllegalArgumentException: Invalid connect parameters:
{connectionTimeout=9000}
        at java.lang.Throwable.<init>(Throwable.java:195)
        at java.lang.Exception.<init>(Exception.java:41)
        at java.lang.RuntimeException.<init>(RuntimeException.java:43)
        at
java.lang.IllegalArgumentException.<init>(IllegalArgumentException.java:36)
        at
org.apache.activemq.transport.activeio.ActiveIOTransportFactory.doConnect(ActiveIOTransportFactory.java:76)
        at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:84)
        at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:210) 
        ... 5 more

I'm using the ActiveMQ 4.0-M4 source download which I modified in Eclipse
and built using Maven (maven -Dmaven.test.skip=true).  Do the Transport
Options remain the same from 3.x to 4.x?


  
--
View this message in context: http://www.nabble.com/Setting-SSL-timeout-value-t1451458.html#a3971182
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Setting SSL timeout value

Posted by James Strachan <ja...@gmail.com>.
If you want to change the value of soTimeout on the SSL socket you can
use the URI syntax...

http://activemq.org/TCP+Transport+Reference

e.g.

ssl://host:port?soTimeout=9000


On 4/14/06, Jason P <co...@yahoo.com> wrote:
>
> Is there an easy way to set the SSL timeout value used by the Transport
> classes?  I have a client application that can connect up via SSL fine
> unless it runs on a slow machine.  I set javax.net.debug=all and can see
> that on the SSL connection that fails the timeout value is getting set to
> 500 ms:
>
> sslsocket: SSLSocket.setSoTimeout()
> sslsocket: timeout = 500
>
> Here as a trace excerpt from my client application.  Anything prefixed with
> a "PT:" is a log statement I added to the ActiveMQ source.  The second
> sslsocket: timeout value listed is the one I'm concerned with (it should be
> in bold):
>
> 04/14/06 11:37:12.844 DEBUG [Thread-0] - Creating ActiveMQConnectionFactory
> using URL: ssl://10.0.1.9:3066
> 04/14/06 11:37:13.568 DEBUG [Thread-0] - Creating ActiveMQ Connection.
> 04/14/06 11:37:13.573 DEBUG [Thread-0] - PT: Enter
> ActiveMQConnectionFactory.createActiveMQConnection()
> 04/14/06 11:37:13.574 DEBUG [Thread-0] - PT: Creating Transport instance by
> using TransportFactory to connect to broker URL "ssl://10.0.1.9:3066".
> 04/14/06 11:37:13.805 DEBUG [Thread-0] - PT: Enter
> TransportFactory.connect(URI location, Executor ex)
> 04/14/06 11:37:13.813 DEBUG [Thread-0] - PT: Enter
> TransportFactory.findTransportFactory(URI location)
> 04/14/06 11:37:13.814 DEBUG [Thread-0] - PT: Getting Scheme from
> locationURI: ssl://10.0.1.9:3066
> 04/14/06 11:37:13.815 DEBUG [Thread-0] - PT: Getting TransportFactory for
> scheme "ssl".
> 04/14/06 11:37:13.816 DEBUG [Thread-0] - PT: TransportFactory is null.
> 04/14/06 11:37:13.817 DEBUG [Thread-0] - PT: Attempting to create new
> TransportFactory for scheme "ssl".
> 04/14/06 11:37:14.005 DEBUG [Thread-0] - PT: Adding newly created
> TransportFactory to TransportFactory list.
> 04/14/06 11:37:14.013 DEBUG [Thread-0] - PT: Returning TransportFactroy for
> scheme "ssl".
> 04/14/06 11:37:14.014 DEBUG [Thread-0] - PT: Leave
> TransportFactory.findTransportFactory(URI location)
> 04/14/06 11:37:14.015 DEBUG [Thread-0] - PT: Leave
> TransportFactory.connect(URI location, Executor ex)
> 04/14/06 11:37:14.016 DEBUG [Thread-0] - PT: Enter
> TransportFactory.createWireFormat(Map options)
> 04/14/06 11:37:14.022 DEBUG [Thread-0] - PT: Creating WireFormatFactory.
> 04/14/06 11:37:14.026 DEBUG [Thread-0] - PT: Enter
> TransportFactory.createWireFormatFactory(Map options)
> 04/14/06 11:37:14.027 DEBUG [Thread-0] - PT: WireFormat not specified in
> options.
> 04/14/06 11:37:14.033 DEBUG [Thread-0] - PT: Getting default WireFormat.
> 04/14/06 11:37:14.033 DEBUG [Thread-0] - PT: Creating new WireFormatFactory
> instance for WireFormat "default".
> 04/14/06 11:37:14.073 DEBUG [Thread-0] - PT: Setting properties of
> IntrospectionSupport.
> 04/14/06 11:37:14.103 DEBUG [Thread-0] - PT: Leave
> TransportFactory.createWireFormatFactory(Map options)
> 04/14/06 11:37:14.106 DEBUG [Thread-0] - PT: Creating WireFormat.
> 04/14/06 11:37:14.986 DEBUG [Thread-0] - PT: Leave
> TransportFactory.createWireFormat(Map options)
> sslctx: Context created.
> sslctx: Supported protocols:
> {
> SSLv2
> SSLv3
> TLSv1
> }
> sslctx: Supported cipher suites:
> {
> SSL_RSA_WITH_RC4_128_MD5
> SSL_RSA_WITH_RC4_128_SHA
> SSL_RSA_WITH_AES_CBC_128_SHA
> SSL_RSA_WITH_AES_CBC_256_SHA
> SSL_RSA_WITH_3DES_EDE_CBC_SHA
> SSL_RSA_WITH_DES_CBC_SHA
> SSL_RSA_WITH_DES_CBC_MD5
> SSL_RSA_WITH_3DES_EDE_CBC_MD5
> SSL_RSA_WITH_RC2_CBC_128_MD5
> SSL_RSA_EXPORT_WITH_RC4_40_MD5
> SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
> SSL_RSA_WITH_NULL_MD5
> SSL_RSA_WITH_NULL_SHA
> }
> sslctx: Default cipher suites:
> {
> SSL_RSA_WITH_RC4_128_MD5
> SSL_RSA_WITH_RC4_128_SHA
> SSL_RSA_WITH_AES_CBC_128_SHA
> SSL_RSA_WITH_AES_CBC_256_SHA
> SSL_RSA_WITH_3DES_EDE_CBC_SHA
> SSL_RSA_WITH_DES_CBC_SHA
> SSL_RSA_WITH_DES_CBC_MD5
> SSL_RSA_WITH_3DES_EDE_CBC_MD5
> SSL_RSA_WITH_RC2_CBC_128_MD5
> SSL_RSA_EXPORT_WITH_RC4_40_MD5
> SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
> }
> sslctx: SSLContext.init()
> sslctx: KeyManager[0] class = com.ibm.jsse.bg
> sslctx: TrustManager[0] class = com.ibm.jsse.bi
> sslctx: SSLContext.getSocketFactory()
> socketfactory: Socket factory created.
> socketfactory: SSLSocketFactory.createSocket()
> socketfactory: host = 10.0.1.9
> socketfactory: port = 3066
> sslsocket: SSL Socket created.
> sslsocket: host = 10.0.1.9
> sslsocket: port = 3066
> sslctx: SSLContextImpl.isInitialized()
> sslctx: SSLContextImpl.initialize()
> sslctx: SSLConfiguration = null
> sslctx: SSLContextImpl.getCertifcateChainAlias()
> sslctx: Certificate authorities list = null
> sslctx: Server = true
> sslctx: SSLContextImpl.getCertificateChain()
> sslctx: Alias = compliancemonitor
> sslctx: SSLContextImpl.getPrivateKey()
> sslctx: Alias = compliancemonitor
> sslctx: SSLContextImpl.getDefaultCipherSuites()
> sslctx: SSLContextImpl.getSupportedProtocols()
> sslsocket: SSLSocket.setEnabledProtocols()
> sslsocket: protocols =
> {
> SSLv2
> SSLv3
> TLSv1
> }
> sslctx: SSLContextImpl.validateProtocols()
> sslctx: Protocols:
> {
> SSLv2
> SSLv3
> TLSv1
> }
> sslsocket: SSLSocketImpl.init()
> sslsocket: roleIsServer = false
> sslsocket: enabledCipherSuites =
> {
> SSL_RSA_WITH_RC4_128_MD5
> SSL_RSA_WITH_RC4_128_SHA
> SSL_RSA_WITH_AES_CBC_128_SHA
> SSL_RSA_WITH_AES_CBC_256_SHA
> SSL_RSA_WITH_3DES_EDE_CBC_SHA
> SSL_RSA_WITH_DES_CBC_SHA
> SSL_RSA_WITH_DES_CBC_MD5
> SSL_RSA_WITH_3DES_EDE_CBC_MD5
> SSL_RSA_WITH_RC2_CBC_128_MD5
> SSL_RSA_EXPORT_WITH_RC4_40_MD5
> SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
> }
> sslsocket: enabledProtocols =
> {
> SSLv2
> SSLv3
> TLSv1
> }
> sslsocket: SSLSocket.connect()
> sslsocket: endpoint = /10.0.1.9:3066
> sslsocket: timeout = 0
> sslsocket: SSLSocket.isClosed()
> sslsocket: SSLSocket.isConnected()
> sslsocket: SSLSocket.getInputStream()
> sslsocket: SSLSocket.isClosed()
> sslinput: Input stream created.
> sslsess: SSLSession.getCipherSuite()
> sslsess: cipherSuite = SSL_NULL_WITH_NULL_NULL
> sslsocket: SSLSocket.isConnected()
> sslinput: conn = [SSL_NULL_WITH_NULL_NULL:
> Socket[addr=10.0.1.9/10.0.1.9,port=3066,localport=9196]]
> sslsocket: SSLSocket.getOutputStream()
> sslsocket: SSLSocket.isClosed()
> ssloutput: Output stream created.
> sslsess: SSLSession.getCipherSuite()
> sslsess: cipherSuite = SSL_NULL_WITH_NULL_NULL
> sslsocket: SSLSocket.isConnected()
> ssloutput: conn = [SSL_NULL_WITH_NULL_NULL:
> Socket[addr=10.0.1.9/10.0.1.9,port=3066,localport=9196]]
> sslsocket: SSLSocket.setReceiveBufferSize()
> sslsocket: size = 65536
> sslsocket: SSLSocket.isClosed()
> sslsocket: SSLSocket.setSendBufferSize()
> sslsocket: size = 65536
> sslsocket: SSLSocket.isClosed()
> 04/14/06 11:37:16.273 DEBUG [Thread-0] - PT: Creating ActiveMQConnection
> using Transport instance and Factory Stats stats{ unit:
> many startTime: 1145039833545 lastSampleTime: 1145039833545 description:
> Used only as container, not Statistic }
> 04/14/06 11:37:16.613 DEBUG [Thread-0] - PT: Setting connection username:
> jasonp
> 04/14/06 11:37:16.614 DEBUG [Thread-0] - PT: Setting connection password.
> 04/14/06 11:37:16.615 DEBUG [Thread-0] - PT: Setting connection
> PrefetchPolicy: org.apache.activemq.ActiveMQPrefetchPolicy@7bdb42d8
> 04/14/06 11:37:16.616 DEBUG [Thread-0] - PT: Setting connection
> DisableTimeStampsByDefault: false
> 04/14/06 11:37:16.617 DEBUG [Thread-0] - PT: Setting connection
> OnSendPrepareMessageBody: true
> 04/14/06 11:37:16.623 DEBUG [Thread-0] - PT: Setting connection
> OptimizedMessageDispatch: true
> 04/14/06 11:37:16.624 DEBUG [Thread-0] - PT: Setting connection
> CopyMessageOnSend: true
> 04/14/06 11:37:16.625 DEBUG [Thread-0] - PT: Setting connection
> UseCompression: false
> 04/14/06 11:37:16.626 DEBUG [Thread-0] - PT: Setting connection
> ObjectMessageSerializationDefered: false
> 04/14/06 11:37:16.627 DEBUG [Thread-0] - PT: Setting connection
> AsyncDispatch: true
> 04/14/06 11:37:16.633 DEBUG [Thread-0] - PT: Setting connection
> UseAsyncSend: false
> 04/14/06 11:37:16.634 DEBUG [Thread-0] - PT: Setting connection
> UseRetroactiveConsumer: false
> 04/14/06 11:37:16.635 DEBUG [Thread-0] - PT: Setting connection
> RedeliveryPolicy: org.apache.activemq.RedeliveryPolicy@7bdb42a8
> 04/14/06 11:37:16.636 DEBUG [Thread-0] - PT: Starting Transport.
> 04/14/06 11:37:16.637 DEBUG [Thread-0] - PT: Transport Class: class
> org.apache.activemq.transport.ResponseCorrelator
> sslsocket: SSLSocket.isBound()
> sslsocket: SSLSocket.getLocalAddress()
> sslsocket: SSLSocket.isBound()
> ssloutput: SSLOutputStream.write()
> ssloutput: data =
> Invalid buffer
> sslsocket: SSLSocketImpl.write()
> sslsocket: len = 22
> sslsocket: SSLSocket.startHandshake()
> sslsocket: SSLSocket.isClosed()
> sslsocket: SSLServerSocket.getLocalPort()
> sslsocket: SSLSocket.isBound()
> sslsocket: SSLSocket.isConnected()
> sslsocket: SSLServerSocket.getInetAddress()
> sslsocket: SSLSocket.isConnected()
> sslsocket: SSLServerSocket.getPort()
> sslsocket: SSLSocket.isConnected()
> sslsocket: SSLSocket.setSoTimeout()
> sslsocket: timeout = 500
> sslctx: SSLContextImpl.validateCertificateChain()
> sslctx: Certificate chain = [[B@33b085fb
> sslctx: Certificate[0] = [B@121efcdf
> sslctx: Server = false
> sslsocket: SSLServerSocket.getHost()
> sslsess: Session created.
> 04/14/06 11:37:16.896 DEBUG [Thread-0] - Leave
> ActiveMQConnectionFactory.createActiveMQConnection()
> 04/14/06 11:37:16.897 DEBUG [Thread-0] - Registering as an ExceptionListener
> for ActiveMQConnection.
> 04/14/06 11:37:16.902 DEBUG [Thread-0] - Starting ActiveMQ Connection.
> sslsocket: SSLSocket.isClosed()
> sslinput: SSLInputStream.read()
> sslinput: off = 0
> sslinput: len = 65536
> sslsocket: SSLSocketImpl.read()
> sslsocket: off = 0
> sslsocket: len = 65536
> sslinput: data =
> Invalid buffer
> sslinput: rc = 22
> 04/14/06 11:37:16.940 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT: WireFormatInfo:
> 04/14/06 11:37:16.946 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   CommandId: 0
> 04/14/06 11:37:16.947 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   Options: 5
> 04/14/06 11:37:16.948 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   Version: 1
> 04/14/06 11:37:16.949 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   DataStructureType: 1
> 04/14/06 11:37:16.950 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   Magic: [B@4bd53392
> 04/14/06 11:37:16.953 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isBrokerInfo: false
> 04/14/06 11:37:16.954 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isCacheEnabled: true
> 04/14/06 11:37:16.955 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMarshallAware: false
> 04/14/06 11:37:16.956 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMessage: false
> 04/14/06 11:37:16.956 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMessageAck: false
> 04/14/06 11:37:16.963 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMessageDispatch: false
> 04/14/06 11:37:16.964 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isMessageDispatchNotification: false
> 04/14/06 11:37:16.964 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isResponse: false
> 04/14/06 11:37:16.965 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isResponseRequired: false
> 04/14/06 11:37:16.966 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isShutdownInfo: false
> 04/14/06 11:37:16.967 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isStackTraceEnabled: true
> 04/14/06 11:37:16.973 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isTcpNoDelay: false
> 04/14/06 11:37:16.974 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isValid: true
> 04/14/06 11:37:16.975 DEBUG [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - PT:   isWireFormatInfo: true
> sslinput: SSLInputStream.read()
> sslinput: off = 22
> sslinput: len = 65514
> ssloutput: SSLOutputStream.write()
> ssloutput: data =
> Invalid buffer
> sslsocket: SSLSocketImpl.write()
> sslsocket: len = 126
> sslsocket: SSLSocketImpl.read()
> sslsocket: off = 22
> sslsocket: len = 65514
> sslinput: data =
>    N  Þ     |  ID:Jasonp-2266-1145033060140-0:0  ssl://localhost:3066
> localhost
> sslinput: rc = 82
> sslinput: SSLInputStream.read()
> sslinput: off = 104
> sslinput: len = 65432
> sslsocket: SSLSocketImpl.read()
> sslsocket: off = 104
> sslsocket: len = 65432
> 04/14/06 11:37:17.554 ERROR [Socket Connection: /10.0.1.178:9196 ->
> 10.0.1.9/10.0.1.9:3066] - ActiveMQ JMS Exception occured.
> javax.jms.JMSException: Read timed out
>         at java.lang.Throwable.<init>(Throwable.java:195)
>         at java.lang.Exception.<init>(Exception.java:41)
>         at javax.jms.JMSException.<init>(JMSException.java:35)
>         at javax.jms.JMSException.<init>(JMSException.java:41)
>         at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:45)
>         at
> org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1327)
>         at
> org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:1337)
>         at
> org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:102)
>         at
> org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:102)
>         at
> org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:102)
>         at
> org.apache.activemq.transport.InactivityMonitor.onException(InactivityMonitor.java:96)
>         at
> org.apache.activemq.transport.activeio.ActiveIOTransport$1.onError(ActiveIOTransport.java:100)
>         at
> org.activeio.command.AsyncChannelToAsyncCommandChannel$1.onPacketError(AsyncChannelToAsyncCommandChannel.java:78)
>         at
> org.activeio.FilterAsyncChannel.onPacketError(FilterAsyncChannel.java:94)
>         at
> org.activeio.FilterAsyncChannel.onPacketError(FilterAsyncChannel.java:94)
>         at
> org.activeio.adapter.SyncToAsyncChannel.run(SyncToAsyncChannel.java:159)
>         at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
>         at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
>         at java.lang.Thread.run(Thread.java:534)
> Caused by: java.io.InterruptedIOException: Read timed out
>         at java.lang.Throwable.<init>(Throwable.java:195)
>         at java.lang.Exception.<init>(Exception.java:41)
>         at java.io.IOException.<init>(IOException.java:40)
>         at
> java.io.InterruptedIOException.<init>(InterruptedIOException.java:45)
>         at
> com.ibm.as400.ibmonly.net.ssl.SSLSocketImpl.read(SSLSocketImpl.java:652)
>         at
> com.ibm.as400.ibmonly.net.ssl.SSLInputStream.read(SSLInputStream.java:133)
>         at
> org.activeio.net.SocketStreamChannel.read(SocketStreamChannel.java:208)
>         at
> org.activeio.net.SocketSyncChannel.read(SocketSyncChannel.java:79)
>         at
> org.activeio.adapter.SyncToAsyncChannel.run(SyncToAsyncChannel.java:145)
>         ... 3 more
> ssloutput: SSLOutputStream.close()
> sslsocket: SSLServerSocket.close()
> sslsocket: SSLSocket.isClosed()
> sslinput: SSLInputStream.close()
> sslsocket: SSLServerSocket.close()
> sslsocket: SSLServerSocket.close()
>
>
> --
> View this message in context: http://www.nabble.com/Setting-SSL-timeout-value-t1451458.html#a3922290
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/

Re: Synchron consume behavior

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hi,

That's because the broker has not delivered any messages to the client
yet.  The messages are on the broker, but consumer.receive() is only
checking to see if the broker has delivered it any messages.

On 4/14/06, Adrian Tarau <ad...@daxtechnologies.com> wrote:
> I'm using ActiveMQ 3.2.2 , embedded with derby for storage, and I have a
> strange behavior when consuming messages.
>
> I know for sure that the queue has more that 100 messages, but if I
> consume with receive() sometime(a lots of times) the result is null,
> like there are no messages. If I put receive(1000) then seems to work
> fine, even if a few times I noticed a null value even if the queue had
> items.
>
> Anybody got some problems like that?
>


--
Regards,
Hiram

Synchron consume behavior

Posted by Adrian Tarau <ad...@daxtechnologies.com>.
I'm using ActiveMQ 3.2.2 , embedded with derby for storage, and I have a 
strange behavior when consuming messages.

I know for sure that the queue has more that 100 messages, but if I 
consume with receive() sometime(a lots of times) the result is null, 
like there are no messages. If I put receive(1000) then seems to work 
fine, even if a few times I noticed a null value even if the queue had 
items.

Anybody got some problems like that?