Worklight SQL Adapter Idle Timeout - ibm-mobilefirst

Is there a way to create and idle time out in the sql adapter.
Right now im getting java.net.SocketException: Broken pipe exceptions when the connection has been idle and the DB has cut it off.
Thanks

Adapter simply rides on top of your jdbc pool. Try configuring idle connection properties for it, e.g. for Tomcat - http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html (search for "idle")

Related

ConnectTimeoutException infinispan

During infinispan cache load randomly I am noticing below error message in my application logs:
Cluster might have completely shutdown, try resetting transport layer and topology id
io.netty.channel.ConnectTimeoutException: connection timed out: 172.XX.20.XX:11222
Checked telnet nc -z ip 11222 is successful at that time, no error in infinispan server logs, number of connections to the server is also not very high.
Infinispan server version 9.4.11
Could anyone help me on what causing this?
Thanks,
Satyabrata Mohanty
What are your Hot Rod client connection/socket timeout configurations ?
I would increase the connection timeout and see if it happens again. If the server is overloaded your connection timeout might not be enough.

How to stop client from reconnecting to server when the server is down?

How can we stop a client from reconnecting to the server after some retries.
In our case (in memory DB for fast retrieval), we have used Ignite and Oracle in parallel so that if Ignite server is down, then I could get my data from Oracle.
But when I start my application (while the Ignite server node is down for some reason), my application always waiting until it connects to server.
Console message:
Failed to connect to any address from IP finder (will retry to join topology every 2000 ms; change 'reconnectDelay' to configure the frequency of retries):
There is a TcpDiscoverySpi.joinTimeout property, which does exactly what you want: https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.html#setJoinTimeout-long-
By default, it's not defined, so, node will try to reconnect endlessly.

LDAP connection reset timer

I am creating LDAP connection using initialldapcontext.
I see there is option like
jndi.ldap.read.timeout - time to wait for read operation
jndi.ldap.connect.timeout - time to wait for connect operation.
I have a requirement where the ldap connection is active but still I have terminated it based on a timer.
For exmaple: there are three ldap server and there is time 5 min. So once a ldap connection is opened it has to be active only for 5 min then it should terminate and then reconnect.
It is some thing like maximum session time for a ldap session.
Whether there is any flag like jndi.ldap.read.timeout or jndi.ldap.connect.timeout for this purpose.
Thanks in advance.
I would suggest using a connection pool. The JNDI LDAP provider documentation shows that there is a system property called com.sun.jndi.ldap.connect.pool.timeout which would do the disconnect part for you. Not the automatic reconnect, though. However, establishing a new connection should not be very expensive (unless you really need to optimize for speed/scale).
The UnboundID LDAP SDK (disclaimer: I work for UnboundID) has more flexible options. See the LDAPConnectionPool class for more details.

How to increase the DB connection Timeout

I have got the connection Timeout in DB. Already I have set connection Timeout to '60sec' in DB. I got the below error. After connecting with DB people ,have found that. The below error is not query command timeout and mostly of connection establishing Mule to DB timeout. I have a doubt
Here Connection Time= 60sec ( means once it reached DB, time to wait to execute the query). Is it correct.
But then how to increase the connection Time out ?, Going through the link
http://www.mulesoft.org/documentation/display/current/Database+Connector+Examples.
Thought to provide maxWaitMillis = 20000 as below. But not sure this is correct ( Because document talks about connection polling and cache, but I dont want cache all over here).
Is it fine, without giving any other value inside connection polling. Just by giving maxWaitMilli timeout is correct for my case or I'm wrong. All I need is need to resolve the below error. Please suggest.
Error:java.sql.SQLException: Cannot get connection for URL jdbc:sqlserver://c01.company.com;database=**;user=***;password=***** : The TCP/IP connection to the host 01.company.com, port 022 has failed. Error: "connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.". (org.mule.module.db.internal.domain.connection.ConnectionCreationException). Message payload is of type: String
<db:generic-config name="DB" url="${db}"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
doc:name="Generic Database Configuration" connectionTimeout="60">
<db:pooling-profile maxWaitMillis="20000"/>
</db:generic-config>
<db:stored-procedure config-ref="DB" doc:name="GetOrderXML">
<db:parameterized-query><![CDATA[{call GetDetailXML('10', ?)}]]></db:parameterized-query>
<db:in-param name="ln" type="CHAR" value="#[flowVars['ID']]"/>
</db:stored-procedure>
Thanks in advance.
maxWaitMillis attribute in db pooling profile is the number of milliseconds a client calling getConnection() will wait for a Connection to be checked-in or acquired when the pool is exhausted. Zero means wait indefinitely.
The other timeout value is the connection timeout which the amount of time a database connection remains securely active during a period of non-usage before timing-out and demanding logging in again.
Both in the link below:
http://www.mulesoft.org/documentation/display/current/Database+Connector+Reference
The query timeout was available in the old jdbc connector (which I assume it will set the JDBC statement queryTimeout attribute) but I cannot find in the new db connector.
http://www.mulesoft.org/documentation/display/current/JDBC+Transport+Reference

RabbitMQ / EasyNetQ drops connections when machine very active?

I'm new to RabbitMQ / EasyNetQ and am trying to better understand a behaviour I am observing. We've seen that when our server running RabbitMQ is busy all EasyNetQ connections are dropped.
This is the exception simultaneously generated on all clients:
System.Exception: Failed to connect to Broker: 'XXXXXX.domain.com',
Port: 5672 VHost: 'XXXX'. ExceptionMessage: 'None of the specified
endpoints were reachable'
EasyNetQ automatically reconnects when the server is no longer busy, but I wonder if it is typical for RabbitMQ/EasyNetQ to drop connections when the machine is busy? (Or if I should be investigating performance issues with my server.)
(PS: By busy, I simply mean updating a large project from source control, relaunching a large ASP.NET application after redeploying it or running a CPU-intensive calculation on large amounts of data. ).
There are limits to the number of connections a RabbitMQ broker will accept. Is it possible that you are rapidly opening a connection, doing some work, then closing it, much as you would with a database connection? If so, that's not how you should interact with the broker. See the EasyNetQ documentation on connections:
https://github.com/mikehadlow/EasyNetQ/wiki/Connecting-to-RabbitMQ