Spring Integration: BindException during test - tcp

I am using TcpNioServerConnectionFactory in some spring contexts being tested with JUnit and the spring test runner.
I sometimes get the following exception when running the tests.
java.net.BindException: Address already in use: bind
So it seems that the listening port is not unbound. Is there any way that I can ensure that the ports are unbound before moving to the next test?
The problem has only been observed on windows until now. So maybe it is related to windows being slower to actually unbind the port?

Actually there is an issue with Windows and closing sockets.
We fixed it recently in Spring Integration 3.0: https://jira.springsource.org/browse/INT-3233
However you have to stop() ConnectionFactory in the end of tests anyway.

Related

Is it possible to connect to an old Kafka version (like 0.11) using new versions of spring-kafka like v2.5.4.RELEASE?

I constructed a spring boot application to produce data in a Kafka, but now I need to connect this application to an old Kafka (0.11v). I tried just changing the bootstrap-server, but I receive connection errors.
I doubled checked if this Kafka instance is working, and other applications are connecting.
My question is if a new version of spring-Kafka like v2.5.4.RELEASE can connect to an old version of Kafka. Is there any configuration I can add to use legacy Kafka instances? I constructed a spring boot application to produce data in a Kafka, but now I need to connect this application to an old Kafka (0.11v). I tried just changing the bootstrap-server, but I receive connection errors.
I doubled checked if this Kafka instance is working, and other applications are connecting.
My question is if a new version of spring-Kafka like v2.5.4.RELEASE can connect to an old version of Kafka. Is there any configuration I can add to use legacy Kafka instances?
In general, yes, as long as you don't use features provided by the newer brokers.
Backwards compatibility for the Java clients has been pretty good since 0.10.2.x.
There is a compatibility matrix here but it hasn't been updated since the 1.0.0 clients.
SK v2.5.4 uses the 2.5.0 clients (2.5.5 uses 2.5.1). I haven't tried connecting to such an old broker lately, what is the nature of the connection errors?
EDIT
I just ran a Boot app using Spring Kafka 2.5.5 against an 0.11.0.3 broker with no problems.

Why is GRPC Unavailable from a different computer?

I have been adding GPRC to a micro service I am working on. So far everything works okay, and I have a simple gatling test to verify things work correctly.
However, things only seem to work when I run gatling on the same system as my micro service. When I run the same test on a different system, I always get back an UNAVAILABLE response.
The first part of the test makes an HTTP request (port 8080), and that always succeeds, but the second part of the test makes a GRPC request (port 8081); which always succeeds on the same system, but always fails when the client is on a different system on the network.
I have tried opening up firewalls and such on Windows where the micro service is running, but no luck.
My micro service is running on Windows, and my other system is OS X.
Does anyone have any troubleshooting tips wrt GRPC?
Programmer error: I was not using the correct test host name on the GRPC port. Test works now, except that it cannot handle the same load as the HTTP test. So, something new to investigate.

Using TcpClient with VPN connection

I'm writing a proprietary Telnet class and use TcpClient. Everything works well in the console and data transmission generates no issue with devices (sockets) in the same IP group. I tested also a new WPF project using this class again and the functionality is given as well.
Today I tried the identical WPF project again using a VPN connection, but TcpClient generates an exception. At the beginning it looks like the first console version was still working as expected, but during several tests, I noticed that even the console version generates sporadically an exception.
I checked the VPN connection and the availability of the IP/port. Everything should be fine. I used Wireshark (I’m not familiar with) and it looks like in the case, the connection fails, there is no request to the IP in the VPN network.
After a restart of the computer, connecting seems to work several times, but after a view tests, it ends with an exception again.
For sure, I have to handle the exception but first of all, I try to solve this connection issue.
Did anybody have experience using TcpClient and VPN? I read, that it’s sometimes recommended to use a bind, but till now, I don't have a solution.
This is a link to the console version I used as a starting point.

How to get the result in Monitor result (Jmeter)?

Am Using asp.net application, i have to view the result in Monitor results(Jmeter). Is there any possible ways to get result in Monitor result.
As per Monitor Results listener documentation
Monitor Results is a new Visualizer for displaying server status. It is designed for Tomcat 5, but any servlet container can port the status servlet and use this monitor.
So there is no simple way to make it work with IIS.
You can use either built-in Windows monitoring tools to check IIS server and underlying OS health or consider using JMeter's Server Performance Monitoring plugin.
I also believe ASP.NET Login Testing with JMeter will be extremely useful

Using Jetty as a web container to allow multiple instances to run under same port

Current Model: One jar file has a Jetty Server embedded which runs on 1 port. I use continuations to suspend HTTP threads and do some actions on timeout.
Jetty Version: 9.2.14
Objective Model: Multiple Instances of Jar must run on the same port (Different Context). For this, I am planning to use jetty as webcontainer. I need to be internally able to still use continuations for suspending Requests. But since Jetty server starting the jars is not inside the jar, can i still use continuations?
I think i am going fundamentally wrong but not able to grasp it. I am open to upgrade Jetty. I read about Jetty 9.3 having inherent suspend ability in each IO requests. But i did not find ample material in the documentation to understand. Can someone help either with an answer or point me to the right direction?

Resources