Mosquitto refuses WebSocket connection after update - websocket

after i´ve updated my mosquitto broker to 2.0.2, it refuses the ws connection from my webapp (8083).
tcp connection from java backend still works fine.
i´ve added
port 1883
listener 8083
protocol websockets
to my mosquitto.conf

With version 2.0.0 of mosquitto the broker is configured by default to deny any connection which does not provide a username:
All listeners now default to allow_anonymous false unless explicitly set
to true in the configuration file. This means that when configuring a
listener the user must either configure an authentication and access control
method, or set allow_anonymous true. When the broker is run without a
configured listener, and so binds to the loopback interface, anonymous
connections are allowed.
see mosquitto changelog
Change your mosquitto.conf to allow_anonymous true to see if that's the problem in your case.
The connection from the backend might still work because you are connecting locally - although to my understanding of the changelog, this should only work if there is no listener configured at all. For sure this could also be a bug

Related

Spring Cloud Stream Binder Kafka broker is not available

I have a Spring Config Server application which is working with Kafka in dev environment but in local environment I keep getting:
{host} could not be established. Broker may not be available.
Is there any way to start the application in local environment even if the broker is not available and not get the warning logs?
The desired behaviour: If broker is not available, application should not have explicit warnings and should continue working.
I have tried to set fatalIfBrokerNotAvailable to false and missingTopicsFatal to false but it does not have any effect.
Unfortunately, the kafka-clients (used by the binder) does not have any API to get the status of the broker(s). So there is no way to determine the state without trying to connect. Those logs are emitted by the kafka-clients code.

How to refresh config clients automatically?

I am new to Spring Config Server/Client technologies.
I am using a spring config server to hold some config values.
Config clients will connect to the server and get the values.
If i change some of the config values at the config server, then currently I have to refresh the clients to load the config details from config server again by invoking "/refresh" on each client.
Is there anyway the clients will be notified by the config server and they will then reload the configuration again ?
Yes there is a way.
The solution is to use the Spring Cloud Bus. Using this module, you would link multiple clients to the server using a message broker. The only message broker implementation currently supported by this module is AMQP. Once the clients are connected to the server, invoking the endpoint on the server /bus/refresh will automatically broadcast the configuration changes to all the subscribed clients. This therefore means it is possible to reload configuration changes for any number of clients with one single refresh request which originates at the server.

ActiveMQ support for TLSv1.2

I'm trying to get ActiveMQ to support a TLSv1.2. I'm using activemq v5.14.5. The fix talked about in Create ActiveMQ Connection on TLS1.2 did not work. When I stepped through the code I see that the
context.setSSLContext(sslContext);
SslContext.setCurrentSslContext(context);
Connection connection = factory.createConnection(loginName, pwd);
call to factory.createConnection() actually doesn't use the value that was just set, but instead creates a new SSL context using the hard coded default of "TLS". I observed this in the debugger.
Any other suggestions are welcome. I think the topic "configuring transports" at http://activemq.apache.org/configuring-transports.html may hold the solution but I haven't tried it yet.
The default embedded ActiveMQ broker configuration does not create an SSL transport connector. If you manually added an SSL transport connector, then you may have restricted the SSL protocols supported by the broker using the option transport.enabledProtocols:
<transportConnector name="ssl" uri="ssl://localhost:61617?transport.enabledProtocols=TLSv1.2"></transportConnector>
This configuration restricts the SSL connector of ActiveMQ to only support TLSv1.2. Other TLSv1, TLSv1.1, SSLv3 will not be supported.

Topic subscriber connection in Tibco

I have a process that starts with a topic subscriber.
What happens with a topic subscriber in Tibco if the EMS server shuts down?
I guess it will reconnect. But how many times or for how long it will try to reconnect?
The behaviour depends on various settings, set either on the client or server.
If you for example use a Java client you can set the behaviour through the connection factory:
TibjmsConnectionFactory.setReconnAttemptCount(10);
TibjmsConnectionFactory.setReconnAttemptDelay(1000);
TibjmsConnectionFactory.setReconnAttemptTimeout(1000);
You also can configure this behaviors on the server by using JNDI connections. Those can be defined through the factories.conf file.
BusinessWorks 5 does not reconnect by default, but honors all JNDI propagated settings.
It will try to connect indefinitely.

How does Spring mange websocket connections to RabbitMQ?

I have a game server that uses websocket for real time multiplayers. It is a Spring 4 application and I use RabbitMQ as my broker. This is my configuration:
<websocket:message-broker application-destination-prefix="/app">
<websocket:stomp-endpoint path="/portfolio">
<websocket:sockjs/>
</websocket:stomp-endpoint>
<websocket:simple-broker prefix="/queue, /topic"/>
</websocket:message-broker>
From a very small test with 4 clients I saw 4 connections open on Rabbit.
Does each client that connects to my server using websocket eventually open a new connection to the broker (RabbitMQ)? Can this be configured?
Yes, each websocket client gets its own TCP connection to the broker. The documentation has a section for connections to the broker (emphasis mine):
A STOMP broker relay maintains a single "system" TCP connection to the broker. This connection is used for messages originating from the server-side application only, not for receiving messages. [...]
The STOMP broker relay also creates a separate TCP connection for every connected WebSocket client. [ ... ]
If this can be configured or not I don't know, I'm not all that familiar with this part of Spring, but I assume it should be; Spring is open to extension. My suggestion is to post an issue on the spring-websocket-portfolio project and ask for specifics.
EDIT : OP opened the following issue on the spring-websocket-portfolio project.

Resources