Java Boker instances and poolsize

i´m confused about how the brokerID parameter “poolsize” works.

Suppose I have a Java Web Application that makes calls to Natural programs throught EntireX Broker.

To do this, we have a pool of java broker objects. We instantiate the corresponding RPCService (came from an IDL) and set a broker object that we teke from the pool.

It´s usefull or make sense that we create broker instances whith the poolsize parameter in the brokerId ??

Wich is the effect if we instatiate those borker object whith differents values of poolsize parameters ?

Thanks for your comments

Hey !! nobody is using java with entireX ???
Please I need to make an application and I must know this issues…
thanks !!!

The recommendation is not use different poolsize parameters for the same Broker. This would have the result that you create multiple socket pools and this is somehow counter-productive.

Practice has shown that the default of 32 sockets works well in most cases for client applications. If the size of your pool of Broker objects is greater then 32 you might consider to increase the pool size.

Hope this helps.

thanks Rolf !!!

by same Broker in your recomendation you mind Broker EntireX Server or the java Broker Object?

Supposse I want to have more then 32 socket… this setting is made in every Java Broker instance ? (in every call to natural programs)
Or this settings is only for that Java Broker Object ? In this case every Java Broker instance have it´s own pool of sockets ?

I really apreciate your oppinion.


the setting is actually per broker ID as specified in the constructor of the Broker class.

new Broker(“host:1234?poolsize=10”,…);
new Broker(“host:1234?poolsize=20”,…);
would create 2 independent socket pools.

In your scenario you should always use the same poolsize parameter in the constructor of the Broker class:
new Broker(“host:1234?poolsize=64”,…);
Then you get one socket pool with a maximum of 64 sockets.

BTW if you set the tracelevel to 1 (e.g. via Broker.setTrace()) then you will see socket pool related messages in the trace.

Rolf, very clear your explanation.

Just for complete my knowledge of the whole process…

If I use the same poolsize parameter in every Broker java instance, suppose 10… this means that I will only have 10 success calls to Natural programs (10 new instance of java Broker objects - one per call) at the same time ?

And in the other hand, how do you see to have differents socket´s pool by differents web applications ? Is this a good aproach or only affect the performance of the Broker Server ?


Whenever the EntireX Java runtime has to call Broker (via TCP/IP or SSL) it will first retrieve an unused socket from the pool, then it will send the data to the Broker using this socket and once the reply from the Broker arrives it will return the socket to the pool.

In case there are no sockets in the pool (and this is the initial state) a new socket instance will be created - as long as the number of created sockets do not exceed the pool size.

What happens if the maximum number of sockets are in use ? In this case, the runtime waits for a free socket to become available. If the wait time expires, the runtime will throw back an 0013 0333 error to the caller (“All sockets in socket pool for {0} are in use (size: {1} sockets)”).

The default wait time is 10 seconds, it can be changed via the system property “entirex.timeout”.

This might happen, but depending on how long one call lasts and how many calls in parallel you do all calls might be successful !

Rolf, correct me if I am wrong, but the calls must be paralell for use the socket pool, because they if they are not paralell, the will be serialized o not ??
So for every call we have to instantiate a java Borker object to make it parallell… or there is another way ?


Because multiple calls going throught the same java Broker Object are serializad… or not ?
I read this in somewhere… and if this is true… how came to play the pool of sokets ??


All calls are using the socket pool.

Serialization occurs only if the same instance of a Broker object is used at the same time in multiple threads.

so, pool size came to play when multiple calls are doing with the same insatance of the java broker object ?