Changing defaults ports for JMS under Glassfish
Why you should do that? All this ports, by default, are allocated dynamically and if you want to use a firewall between your client and JMS broker then you should have static ports assigned. Another solution is to tunnel through httpjms and httpsjms protocol but this are slow. In the next article I will show you how to assign static ports to this JMS service in Glassfish. To show you the all ports what need for JMS I just “ripped” the following table from SUN Site: http://docs.sun.com/app/docs/doc/820-4916/gcuhq?a=view
|
Connection Service |
Configuration Property |
|---|---|
|
jms |
imq.jms.tcp.port |
|
ssljms |
imq.ssljms.tls.port |
|
admin |
imq.admin.tcp.port |
|
ssladmin |
imq.ssladmin.tls.port |
To assign this ports to JMS you should add some parameters in command line.
imqbrokerd -name brokerName -Dimq.jms.tcp.port=10234
But this couldn’t be achieved under Glassfish Server because Glassfish is starting the broker himself. To set them up under Glassfish Server we have 2 possibilities:
1. If we have only 1 domain we can add imq.jms.tcp.port, imq.ssljms.tls.port, imq.admin.tcp.port, imq.ssladmin.tls.port directly under $PATH/glassfish/domains/domain1/imq/instances/imqbroker/props/config.properties, but I don’t recommend that.
2. From Glassfish Administration Console we can add this for each server/domain. Just go to Configurations -> myCluster-config -> Java Message Service and here just add in Start Arguments
-Dimq.jms.tcp.port=48618 -Dimq.ssljms.tcp.port=10235 -Dimq.admin.tcp.port=10236 -Dimq.ssladmin.tls.port=10237
Now just restart the node/domain.
Good luck!
























Leave your response!