New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
1 0 0 0

DACS RFA OpenAPI AuthorizationSystem Does not fall back to next connection in List

I am setting up fallback logic for a DACS Open API system using a comma separated list for the "dacs.daemon" AuthorizationSystem property.

When there is no network connection to the first item in the list, this works as expected and makes a connection to the second item. However when the first item in the list returns a connection down, as we have hit the 8 connection limit on that server it does not fall back to the second item.

My code:

    public DACSClient(String daemonHostRed, String daemonHostBlue)
    {
        this.daemonHost = daemonHostRed + "," + daemonHostBlue;
        try
        {
            openDACSConnection();
            getDACSAgent();
        }
        catch (AuthorizationException e)
        {
            LOGGER.error("Unable to acquire DACS Authorization system", e);

            //Without the DACS we can do nothing.
            onAuthorizationSystemNotAvailableEvent();
        }
    }
    private void openDACSConnection() throws AuthorizationException
    {
        if (dacsEventQueue == null)
        {
            dacsEventQueue = EventQueue.create("dacsEventQueue");
            executorService = Executors.newSingleThreadScheduledExecutor(dacsFactory);
            executorService.scheduleAtFixedRate(this::dispatchEventQueue, 0, 100, TimeUnit.MICROSECONDS);
        }

        if (dacsSystem != null)
        {
            //If the system is already up do nothing
            return;
        }

        AuthorizationSystem.setProperty("dacs.daemon", daemonHost);
        dacsSystem = AuthorizationSystem.acquire();
    }
    private void getDACSAgent() throws AuthorizationException
    {
        dacsAgent = dacsSystem.createAuthorizationAgent("DACS Entitlements Service", true);
        try
        {
            while (dacsAgent.daemonConnectionState() == AuthorizationConnection.CONNECTION_PENDING)
            {
                //noinspection BusyWait
                Thread.sleep(500);
            }

            if (dacsAgent.daemonConnectionState() == AuthorizationConnection.CONNECTION_UP)
            {
                //No way exposed in the dacs openapi to get which of the red/blue we are actually connected to.
                LOGGER.info("DACS Connection UP");
                getDACSService();
                return;
            }
        }
        catch (InterruptedException e)
        {
            LOGGER.error(e.getMessage(), e);
            throw new AuthorizationException(e.getMessage());
        }

        LOGGER.error("DACS Connection DOWN");
        closeConnection(true);
        throw new AuthorizationException("DACS Connection DOWN");
    }


We are NOT using the AuthorizationMCSystem, where I would expect to drop the CONNECTION_DOWN item from the list of available connections, and I do not want to make multiple connections.


What am I missing here?

#technologyopen-dacs
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
87.8k 294 53 79

@malcolm.cudworth

Thank you for reaching out to us.

As far as I know, this is an expected behavior.

The flow should look like this:

The OpenDACS API could establish a connection to the first DACS daemon and the DACS daemon accepted the connection. Then the DACS daemon cut the connection due to its connection limit. In this case, the OpenDACS API will keep reconnect to the first DACS daemon because the first DACS daemon is running and it can accept incoming connections.

If you are a named user of the Refinitiv Developer Connect (API support), you can contact the API support team direclty via Contact Premium Support to confirm this behavior.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 0 0 0

Thanks Jirapongse


In that case I will implement the MC variant of the auth system to move between connections.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.