Home » Clustering, Glassfish, How-to, Java, Newbie

Changing defaults ports for JMS under Glassfish

28 May 2009 One Comment

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 









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!

One Comment »

  • Andi said:

    There’s a typo in the parameter list under the screenshot. -Dimq.ssljms.tcp.port=10235 should be -Dimq.ssljms.tls.port=10235.
    For some reason my gf installation ignores the settings to set the tls ports. Do you have any idea what might cause this behavior?

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.