-
1. Re: Jnp timeouts equivalents
jaysensharma Jul 25, 2012 12:37 PM (in response to qtm)invocation.timeout is the property to set in jboss-ejb-client.properties to configure a specific timeout for the invocations. The value is expected to be specified in milli seconds.
Example:
# A 5 minute invocation timeout
invocation.timeout=300000
Associated JIRA reference: https://issues.jboss.org/browse/AS7-3975
Thanks
Jay SenSharma
-
2. Re: Jnp timeouts equivalents
wdfink Jul 25, 2012 12:47 PM (in response to jaysensharma)invocation.timeout is a different meaning.
This property interrup the sucessful nvokation if it is not returned after that timeout. And this is new in AS7.1 for former AS versions this is not possible.
jnp.timeout is the connection timeout during the first connect to the server.
-
3. Re: Jnp timeouts equivalents
wdfink Jul 25, 2012 1:11 PM (in response to qtm)You can set the connect timeout by using
'remote.connection.<your connection name>.connect.timeout = XXXX'
The time is in milliseconds.
As you see the timeout is per defined connection.
-
4. Re: Jnp timeouts equivalents
qtm Nov 6, 2012 4:30 AM (in response to wdfink)Hi,
Sorry for resurecting this thread, but I don't know how to get the connection name. I've tried "default", but it's not working:
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, org.jboss.naming.remote.client.InitialContextFactory.class.getName());
env.put(Context.SECURITY_PRINCIPAL, "App1");
env.put(Context.SECURITY_CREDENTIALS, "App2");
env.put(Context.PROVIDER_URL, "remote://[my_host]");
env.put("remote.connection.default.connect.timeout", "1");
env.put("remote.connection.default.connect.sotimeout", "1");
-
5. Re: Jnp timeouts equivalents
wdfink Nov 6, 2012 5:40 AM (in response to qtm)You can not use the properties if you use the remote-naming project.
See this document and set the 'remote...timout' within the jboss-ejb-client.properties
-
6. Re: Jnp timeouts equivalents
qtm Nov 6, 2012 5:57 AM (in response to wdfink)Hi Wolf,
I need the timeouts for JMS lookups. If I can't use env.put("remote.connection.default.connect.timeout", "1"), what can I use?
Thanks
-
7. Re: Jnp timeouts equivalents
jaikiran Nov 7, 2012 3:48 AM (in response to qtm)What exactly do you mean by timeout for lookups?
-
8. Re: Jnp timeouts equivalents
qtm Nov 7, 2012 4:47 AM (in response to jaikiran)Hi Jaikiran,
For example a lookup for a CF on a remote server:
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "remote://[my_ip]:4447");
env.put(Context.SECURITY_PRINCIPAL, "test");
env.put(Context.SECURITY_CREDENTIALS, "test1");
Context ctx = new InitialContext(env);
Queue q = (Queue)ctx.lookup("jms/queue/test");
ConnectionFactory factory = (ConnectionFactory)ctx.lookup("/jms/RemoteConnectionFactory");
If the machine is behind a firewall the lookup will hang, I want to set a timeout on this operation. If this line - Queue q = (Queue)ctx.lookup("jms/queue/test") - takes more than 20 seconds to complete, throw an error.
Regards
-
9. Re: Jnp timeouts equivalents
qtm Nov 12, 2012 2:44 AM (in response to qtm)So, what should I do for my lookups of JMS objects?
-
10. Re: Jnp timeouts equivalents
nickarls Nov 12, 2012 3:08 AM (in response to qtm)you might try the jboss.naming.client.connect.timeout
-
11. Re: Jnp timeouts equivalents
jaikiran Nov 14, 2012 1:34 AM (in response to nickarls)That's the connection creation timeout and it won't be used as a timeout for lookups which is what I think qtm is asking for.
-
12. Re: Jnp timeouts equivalents
nickarls Nov 14, 2012 2:07 AM (in response to jaikiran)(did some digging, not sure I ended up in the right place)
So from https://github.com/jbossas/jboss-remote-naming/blob/master/src/main/java/org/jboss/naming/remote/protocol/v1/Protocol.java one would assume it's hardcoded in the DEFAULT_TIMEOUT?