How to monitor multiple JNDI datasources with FlexyPool? - flexy-pool

I am starting to use FlexyPool to monitor an JNDI datasource managed by Tomcat.
I found how to monitor one datasource in this answer and in FlexyPool doc. I can not, however, figure how to configure the monitoring of multiple sources through the flexy-pool.properties file. Is this possible ?

Currently, the declarative configuration only supports a single DataSource. You can open an issue on GitHub for this. I would not mind if you send a Pull request for it.

Related

sftp channel outbound adapter with retry

I am using spring batch and spring integration where once my batch job is completed,it creates texts files and those needs to be uploaded to some ftp server. Sometimes we noticed that those connections drops and it needs to be retried. Is there anyway we can use spring retry project to try few sec later to see if it can upload those files. we want it to be configurable.
If so is there any example out there.
Thanks
Yes, Spring Integration provide retry component for you. It is called RequestHandlerRetryAdvice:
<int-sftp:outbound-channel-adapter>
<int-sftp:request-handler-advice-chain>
<bean class="org.springframework.integration.handler.advice.RequestHandlerRetryAdvice" />
</int-sftp:request-handler-advice-chain>
</int-sftp:outbound-channel-adapter>
Please, find more info in the Reference Manual.
Consider to you use RequestHandlerCircuitBreakerAdvice also for your "connections drops" cases.
And here you are the sample.

Does Feign retry require some sort of configuration?

I just tried to do a attempted a seamless upgrade of a service in a test setup. The service is being accessed by a Feign client. And naively I was under the impression that with multiple instances available of the service, the client would retry another instance if it failed to connect to one.
That, however, did not happen. But I cannot find any mention of how Feign in Spring Cloud is supposed to be configured to do this? Although I have seen mentions of it supporting it (as opposed to using RestTemplate where you would use something like Spring Retry?)
If you are using ribbon you can set properties similar to the following (substituting "localapp" for your serviceid):
localapp.ribbon.MaxAutoRetries=5
localapp.ribbon.MaxAutoRetriesNextServer=5
localapp.ribbon.OkToRetryOnAllOperations=true
ps underneath Feign has a Retryer interface, which was made to support things like Ribbon.
https://github.com/Netflix/feign/blob/master/core/src/main/java/feign/Retryer.java
see if property works - OkToRetryOnAllOperations: true
You can refer application ->
https://github.com/spencergibb/spring-cloud-sandbox/blob/master/spring-cloud-sandbox-sample-frontend/src/main/resources/application.yml
Spencer was quick...was late by few minutes :-)

Wildfly8: Server-level Remote IP Address filtering with Undertow?

How can I only allow requests from my Apache Server in the DMZ access to WildFly over AJP, and block everything else?
This answer works great at deployment level but I would prefer control at the server-level :
At the moment only way to do this is by implementing ServletExtension and add extra handlers that will take care of that.
see http://undertow.io/documentation/servlet/servlet-extensions.html for more on writing extensions
and example of using it:
https://github.com/undertow-io/undertow/blob/master/core/src/test/java/io/undertow/server/handlers/IPAddressAccessControlHandlerUnitTestCase.java
In any case I would encourage you to create new feature request in undertow jira to add proper support for this. Issue tracker can be found at: https://issues.jboss.org/browse/UNDERTOW

How to integrate ActiveMQ with Dell Boomi

I have a tough time integrating the ActiveMQ using Dell Boomi as the Dell Boomi documentation is old and may be misleading too sometimes. As I could not find a good suggestion on the web I am putting my query here. Can someone please help with the steps of how to integrate ActiveMQ with Boomi?
With below steps I got it working--
Copy activemq-core-5.4.3.jar and geronimo-j2ee-management_1.1_spec-1.0.1.jar files from your ActiveMQ to your Atom/usrlib/database (create if not there) directory.
Create a jndi property file and place in ActiveMQ home directory. Reference this.
You might get NoClassDefFound error for JMS/Topic etc, means your Boomi lib does not have the implementation for that. You need to copy activemq-all-5.4.3.jar from ActiveMQ home folder to Atom/lib.
I am not specifying how to create JMS Connection and Operation in boomi however, below properties you can use for JMS conneciton in Boomi--
Connection Factory JNDI Lookup: ConnectionFactory.
Initial Context Factory: org.apache.activemq.jndi.ActiveMQInitialContextFactory (default).
Provider URL: tcp://localhost:61616 (Default port).
JMS Operation--
Destination : dynamicQueues/Dell_Boomi (Dynamic will create a queue if not existing).
That's all, try your luck and share your experience!
pick
jars activemq-client,hawtbuf,geronimo-jms_1.1_spec,geronimo-j2ee-management_1.1_spec
from the lib\plugin\queue and copy it to the lib folder. Restart Atom and it should work now.

How to programmatically un/register POJOs as services in JBoss 4.2.3.GA

I need to be able to circumvent the whole deployer malarkey and programmatically register/unregister (dependency-less) POJOs as services in JBoss.
Currently I'm dynamically creating an MBean interface and registering this with the JBoss MBeanServer, and then registering local/remote with Jndi.
This works ok (I can have a standard service from a vanilla SAR reference one of these service POJOs with the #EJB annotation) - however the container seems to leaves stale references behind as after calling unbind() and unregisterMBean().
Obviously I'm missing something by not dealing with the container in a way it expects, but what am I missing? Or is there an easier way (can't see much in the way of an API)?
thanks.