Haproxy and ActiveMq : how to manage the failover

Hello

I have two clusters of ActiveMq (two cluster of passive/active).

I use them to push notifications to clients, via TCP or Websockets.

These clusters are on two differents AZ on AWS. I route traffic using Haproxy version 2.2.2

Basically, my configuration allow the traffic to go on a default backend and, if this backend is ko, traffic is redirect to the backup backend.
It works pretty well.

But not so much when Defaut Backend finally get up. Clients stay connected to the Backup. I suppose it’s kind of a normal situation as these are long lives connections.
But do you know how I could do to automatically redirect clients to the default backend once it is up, without having to kill the sessions via the socket.

Here is what simply looks like the conf

frontend AAAAA
        bind    : my_port
        mode tcp
        option tcplog
        acl instances_down nbsrv(AAAAA) lt 1
        use_backend AAAAA_BACKUP if instances_down
        default_backend AAAAA

backend AAAAA
        mode tcp
        balance roundrobin

        server amqaza_1 ip:port check inter 5s fall 3 rise 2 maxconn 140 slowstart 30s weight 1
        server amqaza_2 ip:port check inter 5s fall 3 rise 2 maxconn 140 slowstart 30s weight 1 backup

backend AAAAA_BACKUP
       balance roundrobin
       mode tcp

       server amqazb_1 ip:port check inter 5s fall 3 rise 2 maxconn 140 slowstart 30s weight 1
       server amqazb_2 ip:port check inter 5s fall 3 rise 2 maxconn 140 slowstart 30s weight 1 backup```

As you can see, it's pretty basic. It does the job and redirect traffic if no server of AAAA backend repond.
But once they are ok, clients don't come back to AAAA default backend.

Anyone could help me to find a solution ?

(I use haproxy fot websocket as well. Same kind of conf but with HTTP. And same problem)

Thx a lot  !

Regards,

Jaimal