How to configure dynamic endpoints for a service/process? - Forum - Technology Partner - Progress Community

How to configure dynamic endpoints for a service/process?

 Forum

How to configure dynamic endpoints for a service/process?

  • I have an itinerary for which i need to configure endpoints dynamically. Pls help me with the how-to-dos.

  • Try with the cbr or xcbr.

  • Hi I do not mean in the CBR way.

    I do not want to hardcode the endpoints while we develop the service. I want the service to pickup its corresponding end-point dynamically post deployment.

  • The code to do this is basically as follows  You would add this code to your start() method

      XQEndpoint ep = mgr.getEndpoint(strName);

      if(ep != null)

      {

         m_xqLog.logInformation("Registering Entry endpoint : " + strName);

         mgr.registerAsEntryEndpoint(ep, 1);

      }

  • Thanks William. Can you please tell me where do I find the start() method?.

    Should I make a java service type? Pls help me in this regard.

    After having thsi code snippet in place, where should I give my dynamic endpoint so that it can be identified and taken by the service.

    Please elaborate on this.

  • The start method is something you can implement if your java service type does not just implement XQService but XQServiceEx. For the latter you now also have start and stop callbacks from the ESB container.

    If you use the snippet in that method you can register extra (entry) endpoints as well for you service.

    Thomas

  • Would you mind sharing your exact use case.   The Dynaminc Endpont for a service is really an advanced feature usually used when you need to get some replies or data back to a specific instance of a service (when multiple are deployed) -- that is, they'd all have the same 'Entry' but each instance has a dedicated channel.

    For most cases, if you want a servcie to listen to some different place that you only know after deployment, then you change the definition of the Entry Endpoint itself administratively.

    Typically, if you want to listen for different events that are dynamic, you'd do that in a JMS layer and then dispatch messages to the known Entry Endpoint of the Process or Service.  

  • Thanks Thomas.

  • I do not have a use-case as such now. But i developed a service and later felt like externalizing the Endpoints so that in the future if there is any change in the endpoint name or type (from queue to topic and vice versa) I should not face the need to retake the deployed service and change the endpoint and then redeploy it. I am just researching on it but could not find it out.

  • That sounds like you want to tailor the type/name of the endpoints at deployment time (but not runtime).

    For that we provide your with the tailoring map feature (see e.g. esbadmin and applyMap/createMap). It allows you to provide new values during the upload to the target directory service.

    Thomas

  • Thanks Thomas.

    Do we have sonic documents regarding Map feature?

    Moreover if I wanna do it at runtime which is post-deployment how should I go about it?

    I mean that I donot want to go back to the deployed service if there is any change in the endpoint names/type after the service is up and running in the target

    environment? Please help me in this regard.

  • All documentation is accesible from javascript:; Pick the product version you need and then choose the Deployment Guide.

    At true runtime (e.g. the service is running) you would have to revert to the properties files and dynamic endpoints as already disucssed. If it is just a change though that needs to be in effect after a service restart changing it in ESB Explorer might just be enough.

  • Thank you Thomas.

  • Hi Thomas,

        Can you please let me know where I can find info about the Properties file for configuring Dynamic endpoints at true runtime?

  • nithinonpsdn wrote:

    ...

        Can you please let me know where I can find info about the Properties file for configuring Dynamic endpoints at true runtime?

    Using a properties file is not a product feature (directly).  It is code you'd write to manage the Endpoint creation.  (You'd put the property file in SonicFS and then read it with a URLConnection object (e.g. sonicfs://myconfigs/ABC_Entry.properties).

    However, writing the values to a properties file and then uploading it to the DS just gives you the same behavior as modifying the entry endpoint definition.  For your use case, just modify the Entry endpoint itself.   You can do this directly in tooling (SMC), as a script in ESBAdmin, or using the Deploy tool.