How to refresh config clients automatically? - spring

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.

Related

How To setup multiple mail server with failover in Spring Boot?

Sending emails from Spring Boot is as easy as possible.
spring:
mail:
host: <servername>
Plus some additional configuration and off you go.
We rely on an internal email provider that offers two mail servers. Instead of setting these up behind a load balancer, the consumer has to manage the failover itself.
So far, we have therefore only used one of the two servers via the Spring configuration mentioned above.
If this server has a problem, such as the current one where the TLS certificate has expired 🤦‍♂️, the Rediness Check in Spring Actuator floods the log file with error messages.
Does anyone have a solution for using multiple mail servers to provide a fallback scenario?

spring-config-client received multiple refresh event when ever there is a change in consumer-group-name

i am using spring cloud config server, kafka, git and spring cloud bus for to auto-refresh my client properties but when ever i am restarting my client application first time by changing consumer-group-name then i observed that during startup my client application Received remote refresh request multiple times which is equal to the no of times i have committed my client properties changes , but i want to avoid such multiple refresh request during startup.
'spring.cloud.stream.default.group' is the property which i used to define the
consumer-group-name at client application.

Share Websocket Session between Spring Micro Service

I've a Spring boot Application for Web sockets. I'm not using Stomp Web socket.
Is there way we can share web socket sessions across multiple instance of micro service.
Is there a way we can save websocket session in Redis or cassandra?
My use case is, i've multiple instance of my micro service is running, which is listening a kafka queue, so when a message received, i need to send it to the client using web socket session.I'm saving the session in the micro service as a MAP. My problem is any one of my micro service is getting the message, if the session is not available with that micro service the message is not going to the client.
If i'm able to save the websocket sesssion in REDIS or Cassandra, i can query the session and sent to the client.
I can't use Stomp web socket as per the requirement, it has to be normal websocket.
You can't. You have to implement some sort of routing from whatever receives the kafka message, to your micro service.
One simple way to do it would be to store in any datastore (mongo, redis, etc) the IP of the service instance for a given client. That way when you get the message from kafka, an you know who is it for, you lookup which machine has the websocket session for that client. Then you call some http endpoint on that IP that you implement to relay a message for a session it's handling.

How websphere server creates and manages JMS resources internally

When we set up a queue connection factory, a topic connection factory, a queue, a topic in websphere application server throguh the console, what exactly happens?
The server stores the configuration details in an xml and at server startup, it creates the connection factory(ies), topic(s),queue(s) and puts them in a pool?
I ask because the actual queue(s) and topics(s) itself do not reside on the App server, they reside on a separate (remote) websphere MQ server. So why do we need to 'create' the queues in Websphere App server?
The configuration is metadata for connecting to the remote objects. When the server starts (or an app restarts, or configuration is refreshed), the server reads the .xml, then binds Reference objects into JNDI. The actual connection factories aren't created/pooled until the Reference is first looked up.
I don't have enough experience with JMS to answer your second question, but presumably the metadata is required for the queue in order to access it remotely.

Oracle Service Bus (OSB) Proxy Service Endpoint URI change

We have an OSB Proxy Service which is currently setup to receive messages from an external jms queue endpoint URI. We have been tasked with creating a JMS bridge over which to receive external messages.
To this end, we have created a bridge with local jms in/out queues and proceeded to edit the OSB Proxy Service's Endpoint URI from that of the old external jms queue to that of our new local bridge's jms queue. However, when we try to activate the changes, we get: Exception in AppMerge flows' progression message.
Being quite new to all things OSB, I am unsure as to what this error means and whether re-pointing a Proxy Service's Endpoint URI from remote jms queue to local bridge's jms queue is enough for what we are attempting to do.
Any thoughts on this matter would be much appreciated!
Our OSB version is 10gR3.
Regards,
PM.
I think your Proxy is not deployed correctly. I think after creating the bridge and queues, restart your server and then try to work.

Resources