All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
When you run multiple WSO2 products/clusters or multiple instances of the same product on the same server or virtual machines (VMs), you must change their default ports with an offset value to avoid port conflicts. An offset defines the number by which all ports in the runtime (e.g., HTTP/S ports) will be increased. For example, if the default HTTP port is 9763 and the offset is 1, the effective HTTP port will change to 9764. For each additional WSO2 product instance, you set the port offset to a unique value. The offset of the default ports port is considered to be 0.

There are two ways to set an offset to a port:

...

Code Block
languagehtml/xml
<address uri="https://localhost:9445/store/site/blocks/workflow/workflow-listener/ajax/workflow-listener.jag" format="rest"/>

Changing the Inbound web socket websocket port

 

...

Warning

If you are changing the port offset, it is necessary to change the websocket port as well, regardless of whether or not you use websocket APIs.

From API Manager 2.1.0 onwards, you can create and

...

publish websocket APIs. The default port used for websocket APIs is port 9099. 

If you are using multiple using port offsets with multiple API Manager nodes with port offset in a distributed mode, you have need to change the inbound.ws.port in  in the <APIM_HOME>/repository/deployment/server/synapse-configs/default/inbound-endpoints/WebSocketInboundEndpoint.xml  by increment file by incrementing it with the same offset that you used in <APIMin the <APIM_HOME>/repository/conf/carbon.xml file above.

E.g. If your carbon.xml has Offset value 2, WebSocketInboundEndpoint.xml should have  For example, if your carbon.xml file has an offset value of 2, the WebSocketInboundEndpoint.xml file should have an inbound.ws.port  value 9101.

...

value of 9101, as shown below.

Code Block
languagexml
<inboundEndpoint xmlns="http://ws.apache.org/ns/synapse"
                 name="WebSocketInboundEndpoint"
                 sequence="dispatchSeq"
                 onError="fault"
                 protocol="ws"
                 suspend="false">
   <parameters>
      <parameter name="inbound.ws.port"

...

>9101</parameter>
      <parameter name="ws.outflow.dispatch.sequence">outDispatchSeq</parameter>
      <parameter name="ws.pipeline.handler.class">org.wso2.carbon.apimgt.gateway.handlers.WebsocketHandler</parameter>
      <parameter name="ws.subprotocol.handler.class">org.wso2.carbon.inbound.endpoint.protocol.websocket.subprotocols.EchoSubprotocolHandler</parameter>
      <parameter name="dispatch.custom.sequence">true</parameter>
      <parameter name="ws.outflow.dispatch.fault.sequence">fault</parameter>
      <parameter name="ws.client.side.broadcast.level">0</parameter>
   </parameters>
</inboundEndpoint>

...

 

...

For a list of all default ports opened in WSO2 API Manager, see Default Product Ports.