In Oracle 12c IDEs for Service Bus has been integrated in JDeveloper. The development of Service Bus services looks very much like the development of SCA Composites.
But unlike a SOA project where a config plan can be generated for the project in jdeveloper, No such option exists for OSB projects. I came across a scenario in OSB, where I wanted to change a webservice url before deploying to another environment, which is a very common requirement. Here I am going to discuss the environment values and how to change them from OSB console.
Environment Values
Environment values represent data in the Service Bus configuration that are likely to change when you move your configuration from one domain to another (for example, from test to production). These are predefined fields, and environment values correspond to the properties you configure when you create a service or resource for Service Bus.
Environment values represent entities such as URLs, URIs, file and directory names, server names, email servers, and so on. A good example is the URL of a proxy service, which changes depending on the physical location of the domain. Some of the environment values are listed below
Environment Value | Found In | Description |
Service Retry Count | Business service | The number of times endpoint URIs are retried for a business service; in other words, the number of failover attempts. |
Service Retry Iteration Interval | Business service | The length of time that a business service waits before iterating over the entire set of URIs again. |
Service URI | Proxy or business service | Proxy or business service URI. This variable includes a location in the configuration file. The location is not defined for proxy services. |
Service URI Weight | Business service | The individual weights assigned to business service URIs. This variable includes a location in the configuration file. |
Proxy Server Host | Proxy server | The host name of a proxy server in a proxy server resource. This variable includes a location in the configuration file. |
Proxy Server Port | Proxy server | The port number of a proxy server in a proxy server resource. This value is an integer. This variable includes a location in the configuration file. |
There are two ways to update environment values in a domain
a) Find and Replace
you can search for environment values in a domain and view a list of matching values
I have created a simple OSB project to demonstrate the same.
Here the endpoint url of business service changes with respect to the environment where the OSB project is to be deployed.
We can replace this url from OSB console by following below steps
1) Log into Oracle Service Bus Console .If you are in a session, you can find and replace environment values. However, if you are outside a session, you can only find environment values
3) The Find and Replace dialog appears.
In the Find Value field, enter the environment value that you want to find.
You can enter a partial value in this field.
In the Variable Type list, select the type of environment value for which to search. To locate environment values located in a particular project, select the project name from the Project list. Click Find.
A list of matching values appears on the Find and Replace Results tab at the bottom of the page
4) In the Replace with field, enter the new environment value that will replace the value you entered in the Find Value field. click Replace..All occurrences of the value you entered in the Find Value field are replaced with the environment value you entered in the Replace with field in the current session.
5) To end the session and deploy the configuration to the runtime, click Activate.
5) To end the session and deploy the configuration to the runtime, click Activate.
b) Configuration Files
Configuration files are XML-based files that define environment values, operational settings, and reference mappings used by Service Bus. Because they are XML-based, you can easily m0odify a generated configuration file.
1) On the Oracle Service Bus Console, select the Admin tab, and then click Create Configuration File.
1) On the Oracle Service Bus Console, select the Admin tab, and then click Create Configuration File.
The Create Configuration File page appears with a list of objects in your configuration.
2) Select the projects or resources you want to include in the configuration file.
3)Click Create.
3)Click Create.
4) In the File Download dialog box, click Open to open the file or click Save to save the file to your local machine.
In an XML editor, use the customization schema in conjunction with the base configuration file you created to make the necessary modifications to resources and environment variables.
Executing a Configuration File
Once you create a configuration file and update the values for the new domain, you can execute the file that was previously saved on your system. You must be in a session to execute a configuration file.
To execute a configuration file:
- click Execute Configuration File.
- Click Browse, and navigate to and select a configuration file to execute.
- Review all changes listed in the summary to be sure they are correct.
- Click Finish to commit the updates in the current session.
To end the session and deploy the configuration to the runtime, click Activate
Reference https://docs.oracle.com/middleware/1213/osb/administer/GUID-6FBDE1BB-CAF5-40FC-BC88-D590828AB66C.htm#OSBAG2259
HAPPY LEARNING !!!!