OSB Configuration files allow the developer to manage environment specific values during deployment.  FlexDeploy supports the use of these configuration files and extends them to using tokens in the configuration file that will get replaced with configured properties from FlexDeploy.   This way we do not need to generate a customization file for every environment where we are going to deploy the project.  We can have one configuration file that will work across environments.

My example is built using JDeveloper and SOA 12.2.1.  I have an OSB project named ValidatePayment that is acting as a proxy service for a SOA service:

osbconfig_2_overview

The ValidateBS when I run locally, refers to localhost:

osbconfig_1_jdev

When I deploy this to our shared development environment, I want to replace http://localhost.flexagon:7001/ with http://soalt05.flexagon:7001/.  When I deploy to production, I want the URL to be http://soa.flexagon.com/.  To accomplish this I add a property to my OSB Deploy workflow in FlexDeploy.  First, I will show the full workflow for the OSB deploy.  Since FlexDeploy has smart plugins, the deploy workflow is a simple 1 step process to import the OSB project:

osbconfig_3_wf

Now I add the property on the main tab of the workflow:

osbconfig_4_wfprop

I made it an Environment Instance property so I configure it once for each environment (dev, prod) and not once for every project.  Now, I will set the property on the property environment/instance page for Dev, then similarly for Prod:

osbconfig_5_envinst

FlexDeploy will scan the OSB configuration file and will look for any tokens with the format ${{….}} and replace it with the value of the configured property from FlexDeploy.  So, I adjust the configuration file to reference the FlexDeploy workflow property we just created.

<xt:replace>

<xt:envValueType>Service URI</xt:envValueType>

<xt:location>0</xt:location>

<xt:value xsi:type=”xs:string” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>${{SOASERVER_URL_PREFIX}}/soa-infra/services/default/ValidatePayment/ValidatePayment</xt:value>

</xt:replace>

 

In my OSB project on FlexDeploy, I set the path to my OSB configuration file on the properties page.  In this case, the customization file is located in my project.  If it is external to the project you can either use a fully qualified path or relative path to the project.  (Note: FlexDeploy also supports configuration files that have environment in the name such as ValidatePayment_CustomizationFileDEV.xml)

osbconfig_6_projprop

Now we deploy the project to soalt05:

osbconfig_7_deploy

Finally, we check the deployed service in the sbconsole to see that the URL change was made after deployment:

osbconfig_8_sbconsole

In summary, using the token replacement can reduce the complexity of setting up your OSB configuration files.

Download the Datasheet

Greg Draheim

I am a Principal Architect with Flexagon focused on providing DevOps and CD solutions for microservices. Over the past 25 years, I have architected and implemented complex integration systems and recognize the value of automating both testing and deployment. I have also leveraged my integration expertise to assist in the design and implementation of FlexDeploy's integration plugins.

More posts by Greg Draheim
    

1 Comment

  • Ciprian says:

    Hi Greg,

    Nice article on OSB customization file.
    Is there any possibility to deploy the same archive file with different customization files to achieve multiple projects in OSB?
    I have a “generic” archive where the resources are in a path like “GenericModule\PassThrough\ProxyService”. I want to deploy it once for “MODULE1\PassThroughProxyService” and again to “MODULE2\PassThroughProxyService”. Then to customize the URI for each module (this one I managed to do it). I am still using OSB 12.1.3 :(.

    The main reason is that I need multiple projects(>10) for a PassThrough service that should serve different modules(>10) so I though of having a single piece of code customized at the deployment time instead of having multiple OSB projects having the same code.

    I have tried using the by renaming them but does not work, maybe there is still something to be done extra.

Leave a Reply

Your email address will not be published. Required fields are marked *