Search code examples
oracle-coherencecoherence-toolkit

How to configure the Unicast listener address with dynamic address and port values in Coherence


We are using Coherence concept in our ADF fusion application and using Unicast lister for creating a cluster. As of now while running coherence in local we are using the local system address and port values in tangosol-coherence-override.xml file.

How can we update the address and port values as per the environment in tangosol-coherence-override.xml file.

Please suggest us on this.

Regards, Joseph


Solution

  • You could use tangosol-coherence-override-dev.xml file in development and tangosol-coherence-override-prod.xml in production. According to Coherence documentation:

    • tangosol-coherence-override-dev.xml – This file overrides operational settings in the tangosol-coherence.xml file when Coherence is started in developer mode. By default, Coherence is started in developer mode and the settings in this file are used. The settings in this file are suitable for development environments. The schema file for this override file and the schema for the operational deployment descriptor are the same.
    • tangosol-coherence-override-prod.xml – This file overrides operational settings in the tangosol-coherence.xml file when Coherence is started in production mode. The settings in this file are suitable for production environments. The schema file for this override file and the schema for the operational deployment descriptor are the same.

    If you need more flexibility (e.g. you have separate environments for development, integration testing, staging, etc.), you can use tangosol.coherence.override system property to specify configuration file that should be used. Chapters 3.7 and 3.8 in Coherence documentation explain those configuration possibilities in detail.