Socket read timeout

2018-03-29 Thread Suresh
Hello All

We have AMQ Broker in one linux machine. We are trying to consume message
using simple client.

I have opened one AMQ connection and using the same connection by giving
inactivity timeout as 2 hours in while loop consuming messages. Few messages
are coming after that giving below error

Starting SimpleJMS example now...

on the broker side not seeing any errors [ this might be we are not enabling
related logs also]
so can anybody suggest which logs to enable on broker & what might be reason
for this.
 
 
receiving
javax.jms.JMSException: Failed to perform GET on: https://URL Reason: Read
timed out
at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:72)
at
org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:476)
at
org.apache.activemq.ActiveMQMessageConsumer.receive(ActiveMQMessageConsumer.java:557)
at org.apache.activemq.recipes.SimpleJMS.run(SimpleJMS.java:108)
at org.apache.activemq.recipes.SimpleJMS.main(SimpleJMS.java:128)
Caused by: java.io.IOException: Failed to perform GET on: https://URL
Reason: Read timed out
at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:33)
at
org.apache.activemq.transport.http.HttpClientTransport.run(HttpClientTransport.java:205)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:961)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:918)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:160)
at
org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:84)
at
org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:273)
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
at
org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261)
at
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:283)
at
org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
at
org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
at
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272)
at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:124)
at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:712)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:517)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at
org.apache.activemq.transport.http.HttpClientTransport.run(HttpClientTransport.java:178)
... 1 more
javax.jms.IllegalStateException: The Session is closed
at
org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:775)
at
org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:1292)
at
org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:1251)
at
org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:1163)
at
org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:1135)
at org.apache.activemq.recipes.SimpleJMS.run(SimpleJMS.java:103)
at org.apache.activemq.recipes.SimpleJMS.main(SimpleJMS.java:128)
Caught an exception during the example: The Session is closed
Finished running the SimpleJMS example.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


jdbc WARNING messages on slave node

2018-03-29 Thread hfarooqui
I have 4 broker configuration spread across two nodes. Each node hosts a
master node and a slave node(whose master is on the other node)

No since master nodes have already acquired the lock I see following JDBC
warnings in slave activemq.log:
Is there a way to suppress these warnings?


2/018-03-29 19:28:57,847 | WARN  | Could not create JDBC tables; they could
already exist. Failure was: CREATE INDEX ACTIVEMQ_ACKS_XIDX ON ACTIVEMQ_ACKS
(XID) Message: ERROR: relation "activemq_acks_xidx" already exists SQLState:
42P07 Vendor code: 0 |
org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter | main
2018-03-29 19:28:57,847 | WARN  | Could not create JDBC tables; they could
already exist. Failure was: CREATE INDEX ACTIVEMQ_ACKS_XIDX ON ACTIVEMQ_ACKS
(XID) Message: ERROR: relation "activemq_acks_xidx" already exists SQLState:
42P07 Vendor code: 0 |
org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter | main
2018-03-29 19:28:57,848 | WARN  | Failure details: ERROR: relation
"activemq_acks_xidx" already exists |
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter | main
org.postgresql.util.PSQLException: ERROR: relation "activemq_acks_xidx"
already exists
...
2018-03-29 19:28:57,852 | WARN  | Could not create JDBC tables; they could
already exist. Failure was: CREATE TABLE ACTIVEMQ_LOCK( ID BIGINT NOT NULL,
TIME BIGINT, BROKER_NAME VARCHAR(250), PRIMARY KEY (ID) ) Message: ERROR:
relation "activemq_lock" already exists SQLState: 42P07 Vendor code: 0 |
org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter | main
2018-03-29 19:28:57,852 | WARN  | Failure details: ERROR: relation
"activemq_lock" already exists |
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter | main
org.postgresql.util.PSQLException: ERROR: relation "activemq_lock" already
exists/



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html


Re: Can I connect to a vm URL without a password?

2018-03-29 Thread Tim Bain
Thanks for creating the request; what you did sounds fine.

Tim

On Thu, Mar 29, 2018, 11:31 AM Quinn Stevenson 
wrote:

> Thanks for all your help Tim.
>
> I created https://issues.apache.org/jira/browse/AMQ-6941 <
> https://issues.apache.org/jira/browse/AMQ-6941> for this request, and I
> put a link to the example implementation in the JIRA rather than the
> source.  I did it that way because the jar with the plugin is in Maven
> Central, and the source can be found on Github.
>
> I’ll be moving this customer to Artemis in the near future - I guess I’ll
> have to look at doing the same thing in Artemis.
>
> Thanks Again
>
>
> > On Mar 27, 2018, at 7:12 AM, Tim Bain  wrote:
> >
> > Quinn,
> >
> > Great, I'm glad you got it working.
> >
> > Yes, I think there would be benefit to having this capability. However,
> I'm
> > not sure if what you've implemented is the ideal implementation from a
> > long-term maintenance standpoint (I suspect that we'd want to fold it
> into
> > the Simple Authentication Plugin, with configuration options to turn it
> on
> > and off and possibly a way to specify the set of protocols that do not
> > require authentication), so I suggest you create an enhancement request
> in
> > JIRA and attach your implementation to it. Whoever implements the
> > enhancement request can use the core of your code and wrap the
> appropriate
> > options around it in the Simple Authentication Plugin (or wherever else),
> > and anyone who wants the capability before it gets implemented officially
> > can grab your plugin file off of the enhancement request.
> >
> > Tim
> >
> > On Mon, Mar 26, 2018, 9:48 PM Quinn Stevenson <
> qu...@pronoia-solutions.com>
> > wrote:
> >
> >> Thanks Tim - I think I’ve got one working now.
> >>
> >> I wound up casting the result of getConnector() to TransportConnector
> and
> >> then calling getName() - it looks like it has what I need.
> >>
> >> I’ve got a version running locally now, and it seems to be doing what
> I’m
> >> after.  Thanks for all of your help.
> >>
> >> BTW - let me know if you think this is something the community would
> like
> >> and I’ll put together a PR for it.
> >>
> >> Thanks Again
> >> Quinn
> >>
> >>> On Mar 25, 2018, at 11:11 PM, Tim Bain  wrote:
> >>>
> >>> Quinn,
> >>>
> >>> I think you should be able to access the URI to which the connection is
> >>> bound by calling
> >>>
> ((TransportConnector)context.getConnector()).getServer().getConnectURI(),
> >>> and then you can parse the protocol out of it. But it's not something
> >> I've
> >>> personally done and I don't have time to try it right now, so this is
> >>> purely conjecture based on the documentation plus reading the code. So
> if
> >>> that doesn't work, I apologize, but let me know how it blows up and I
> can
> >>> try to help further.
> >>>
> >>> Tim
> >>>
> >>> On Thu, Mar 22, 2018 at 10:22 AM, Quinn Stevenson <
> >>> qu...@pronoia-solutions.com> wrote:
> >>>
>  Thank you Tim -
> 
>  I was afraid you were going to say that :-)
> 
>  I was looking at the SimpleAuthenticationPlugin /
>  SimpleAuthenticationBroker, and I have an idea how to do this.  The
> one
>  thing I’m not sure about is how I can tell when the connection is
> coming
>  via a VM URL - do you have any hints on that?
> 
> 
> > On Mar 21, 2018, at 7:21 PM, Tim Bain  wrote:
> >
> > I'm not sure there's a built-in way to do this without writing any
> >> code,
> > but you should be able to write a simple security plugin that allows
> >> you
>  to
> > allow or deny connections based on their transport and whether they
> are
> > anonymous. The bottom of http://activemq.apache.org/security.html
> has
> > details about how to get started.
> >
> > Tim
> >
> > On Wed, Mar 21, 2018, 6:08 PM Quinn Stevenson <
>  qu...@pronoia-solutions.com>
> > wrote:
> >
> >> I have several components running inside the same JVM as ActiveMQ,
> and
> >> they connect to the broker using a vm URL.  Guest access to the
> broker
>  has
> >> been disabled for security reasons, but I’d like the embedded
>  components to
> >> be able to connect to the broker without a username or password.
> >>
> >> Is there a way to configure ActiveMQ to allow anonymous/guest access
> >> for
> >> VM connections only?
> >>
> >>
> >>
> >>
> 
> 
> >>
> >>
>
>


Re: Can I connect to a vm URL without a password?

2018-03-29 Thread Quinn Stevenson
Thanks for all your help Tim.

I created https://issues.apache.org/jira/browse/AMQ-6941 
 for this request, and I put a 
link to the example implementation in the JIRA rather than the source.  I did 
it that way because the jar with the plugin is in Maven Central, and the source 
can be found on Github. 

I’ll be moving this customer to Artemis in the near future - I guess I’ll have 
to look at doing the same thing in Artemis.

Thanks Again


> On Mar 27, 2018, at 7:12 AM, Tim Bain  wrote:
> 
> Quinn,
> 
> Great, I'm glad you got it working.
> 
> Yes, I think there would be benefit to having this capability. However, I'm
> not sure if what you've implemented is the ideal implementation from a
> long-term maintenance standpoint (I suspect that we'd want to fold it into
> the Simple Authentication Plugin, with configuration options to turn it on
> and off and possibly a way to specify the set of protocols that do not
> require authentication), so I suggest you create an enhancement request in
> JIRA and attach your implementation to it. Whoever implements the
> enhancement request can use the core of your code and wrap the appropriate
> options around it in the Simple Authentication Plugin (or wherever else),
> and anyone who wants the capability before it gets implemented officially
> can grab your plugin file off of the enhancement request.
> 
> Tim
> 
> On Mon, Mar 26, 2018, 9:48 PM Quinn Stevenson 
> wrote:
> 
>> Thanks Tim - I think I’ve got one working now.
>> 
>> I wound up casting the result of getConnector() to TransportConnector and
>> then calling getName() - it looks like it has what I need.
>> 
>> I’ve got a version running locally now, and it seems to be doing what I’m
>> after.  Thanks for all of your help.
>> 
>> BTW - let me know if you think this is something the community would like
>> and I’ll put together a PR for it.
>> 
>> Thanks Again
>> Quinn
>> 
>>> On Mar 25, 2018, at 11:11 PM, Tim Bain  wrote:
>>> 
>>> Quinn,
>>> 
>>> I think you should be able to access the URI to which the connection is
>>> bound by calling
>>> ((TransportConnector)context.getConnector()).getServer().getConnectURI(),
>>> and then you can parse the protocol out of it. But it's not something
>> I've
>>> personally done and I don't have time to try it right now, so this is
>>> purely conjecture based on the documentation plus reading the code. So if
>>> that doesn't work, I apologize, but let me know how it blows up and I can
>>> try to help further.
>>> 
>>> Tim
>>> 
>>> On Thu, Mar 22, 2018 at 10:22 AM, Quinn Stevenson <
>>> qu...@pronoia-solutions.com> wrote:
>>> 
 Thank you Tim -
 
 I was afraid you were going to say that :-)
 
 I was looking at the SimpleAuthenticationPlugin /
 SimpleAuthenticationBroker, and I have an idea how to do this.  The one
 thing I’m not sure about is how I can tell when the connection is coming
 via a VM URL - do you have any hints on that?
 
 
> On Mar 21, 2018, at 7:21 PM, Tim Bain  wrote:
> 
> I'm not sure there's a built-in way to do this without writing any
>> code,
> but you should be able to write a simple security plugin that allows
>> you
 to
> allow or deny connections based on their transport and whether they are
> anonymous. The bottom of http://activemq.apache.org/security.html has
> details about how to get started.
> 
> Tim
> 
> On Wed, Mar 21, 2018, 6:08 PM Quinn Stevenson <
 qu...@pronoia-solutions.com>
> wrote:
> 
>> I have several components running inside the same JVM as ActiveMQ, and
>> they connect to the broker using a vm URL.  Guest access to the broker
 has
>> been disabled for security reasons, but I’d like the embedded
 components to
>> be able to connect to the broker without a username or password.
>> 
>> Is there a way to configure ActiveMQ to allow anonymous/guest access
>> for
>> VM connections only?
>> 
>> 
>> 
>> 
 
 
>> 
>>