Application AppNodes using different ports in the same host

In the today post we are going to learn how to deploy a Web service in two AppNodes using different ports to receiving requests. When I named a “Web Service” I’m referring to a Process that expose an HTTP connection to receive requests.

You may think this is not a problem if I want to deploy an application using the TIBCO BW 6.x series I upload the Application Archive to the TEA and I start the Application deployment in the different nodes. Ok, first of all you should know that the configuration values are the same, at first, for every AppNode you deploy. Another important thing is that if you create an HTTP Resource with the default configuration the port is not configured used a property (this is not occurring with the hostname value, for example), so you have to do the following tasks:

  • Configure your HTTP Resource inside your application to specify the port number using a Module Property.
  • Change the initial configuration at least in one AppNode.

Configure HTTP Resource

If you want to configure the HTTP Resource to change this behavior, you should create a Module Property (inside the Module Descriptor) and add a User Defined Property, as you can see here. In my case the property is named “CUSTOM.APPNODE.PORT”. The only constraint you have when you are naming a property is that it cannot start with BW. because these properties are restricted to “system variables”.

Property1

After that you have to refer to that property in the HTTP Resource configuration. You’ll have to change the option that claims that the property will be specified using a Module Property and not a Literal Value. Then, you only have to specify the property you created in the previous step.

Property2

Change Configuration

When you deployed the Application Archive in two nodes inside the same host you will be facing an Start Failed error in one of the application. That’s because both of the application try to start an HTTP Connector listening to the same port in the same host and that’s not possible so one of then it is going to fail and show us the error:

Property4

Property5

So, we need to go to the Application Configure tab and inside the App Instance tab. In this section you’ll see two lists of properties one of each AppNode that have deployed the application:

Property6

And then, you need to specify a different port number at least for one of the AppNodes, in my case I’ll be changing the Test AppNode configuration from 9090 to 9099 and restart both of the application and then, both of them are in running state:

Property7

That’s all for today! If you have any feedback, doubts or problems about this topic, please leave a comment in the comment area under this post.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s