You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Senaka Fernando <se...@gmail.com> on 2008/05/20 00:09:15 UTC

Need to understand the purpose of certain elements in config.xml

Hi all,

I thought of explaining the various config options in detail in the README
for the Java Broker covering the config.xml as well. I don not quite
understand the purpose of certain elements. It would be quite helpful if
someone could answer the questions below so that I'm certain that I properly
understood their purpose.

1. what does sslOnly = true do?
2. what does qpidnio = true do?
3. what are the possible values for transport
4. need to know about socketReceiveBuffer, socketSendBuffer size usage
(valid range etc.)
5. what's protectio all about.

Thanks,
Senaka

Re: Need to understand the purpose of certain elements in config.xml

Posted by Senaka Fernando <se...@gmail.com>.
Hi Martin,

I will not explain the advanced configuration section in my Java Broker
README in that case. I will just limit to two lines explaining its intent.
Also, i did figure out the ${conf} is a directory. But there is no
subdirectory named virtualhosts as yet, which seem to be answered in your
reply.

Regards,
Senaka

On Tue, May 20, 2008 at 5:53 PM, Martin Ritchie <ri...@apache.org> wrote:

> 2008/5/20 Senaka Fernando <se...@gmail.com>:
> > Hi again,
> >
> > Thanks for the valuable guidelines. I'm almost done writing the README
> for
> > the config.xml. However, I'm yet to understand the,
> >
> >    <advanced>
> >        <filterchain enableExecutorPool="true"/>
> >        <enablePooledAllocator>false</enablePooledAllocator>
> >        <enableDirectBuffers>false</enableDirectBuffers>
> >        <framesize>65535</framesize>
> >        <compressBufferOnQueue>false</compressBufferOnQueue>
> >        <enableJMSXUserID>false</enableJMSXUserID>
> >    </advanced>
> >
> > section. As it seems it is a bit advanced to figure out. :)...
> >
> > Also, there are two elements configuring virtualhosts. I would like to
> know
> > how this works out. And, I would also like to understand what
> > <directory>${conf}/virtualhosts</directory> actually points to.
>
> This one has an outstanding bug. ${conf} is not as you would expect
> 'the value configured at the start of the config.xml' it is the
> directory that contains the config.xml file.
>
> The two virtualhost elements are simply combined. And should
> eventually be split out. so we have:
> config.xml
> virtualhosts/localhost.xml
> virtualhosts/test.xml
> ...
>
> I'd also like to see a lot of items removed from config.xml the whole
> advanced section for example. There is no need for a user to tweak
> these values and more chance they will break something. The items that
> they may want JMSXUserID and BufferCompression(perhaps not) could be
> factored in elsewhere. Perhaps per virtualhost or even per queue.
>
> Cheers
> Martin
>
>
> > Regards,
> > Senaka
> >
> > On Tue, May 20, 2008 at 5:37 PM, Robert Greig <ro...@gmail.com>
> > wrote:
> >
> >> 2008/5/20 Senaka Fernando <se...@gmail.com>:
> >> > Hi Robert,
> >> >
> >> > Thanks for the reply. I would like to know whether
> >> > <transport>nio</transport> is deprecated and, the meanings of
> >>
> >> Well, at one time we had another (non-nio) transport but it wasn't any
> >> faster so it probably got removed. At the moment it's the only option
> >> but that does not preclude a new one in future of course,
> >>
> >> > 1. security/principal-databases/principal-database/class
> >> > 2. security/access/class
> >>
> >> Take a look at:
> >> http://cwiki.apache.org/qpid/qpid-design-authentication.html which I
> >> think covers this.
> >>
> >> RG
> >>
> >
>
>
>
> --
> Martin Ritchie
>

Re: Need to understand the purpose of certain elements in config.xml

Posted by Martin Ritchie <ri...@apache.org>.
2008/5/20 Senaka Fernando <se...@gmail.com>:
> Hi again,
>
> Thanks for the valuable guidelines. I'm almost done writing the README for
> the config.xml. However, I'm yet to understand the,
>
>    <advanced>
>        <filterchain enableExecutorPool="true"/>
>        <enablePooledAllocator>false</enablePooledAllocator>
>        <enableDirectBuffers>false</enableDirectBuffers>
>        <framesize>65535</framesize>
>        <compressBufferOnQueue>false</compressBufferOnQueue>
>        <enableJMSXUserID>false</enableJMSXUserID>
>    </advanced>
>
> section. As it seems it is a bit advanced to figure out. :)...
>
> Also, there are two elements configuring virtualhosts. I would like to know
> how this works out. And, I would also like to understand what
> <directory>${conf}/virtualhosts</directory> actually points to.

This one has an outstanding bug. ${conf} is not as you would expect
'the value configured at the start of the config.xml' it is the
directory that contains the config.xml file.

The two virtualhost elements are simply combined. And should
eventually be split out. so we have:
config.xml
virtualhosts/localhost.xml
virtualhosts/test.xml
...

I'd also like to see a lot of items removed from config.xml the whole
advanced section for example. There is no need for a user to tweak
these values and more chance they will break something. The items that
they may want JMSXUserID and BufferCompression(perhaps not) could be
factored in elsewhere. Perhaps per virtualhost or even per queue.

Cheers
Martin


> Regards,
> Senaka
>
> On Tue, May 20, 2008 at 5:37 PM, Robert Greig <ro...@gmail.com>
> wrote:
>
>> 2008/5/20 Senaka Fernando <se...@gmail.com>:
>> > Hi Robert,
>> >
>> > Thanks for the reply. I would like to know whether
>> > <transport>nio</transport> is deprecated and, the meanings of
>>
>> Well, at one time we had another (non-nio) transport but it wasn't any
>> faster so it probably got removed. At the moment it's the only option
>> but that does not preclude a new one in future of course,
>>
>> > 1. security/principal-databases/principal-database/class
>> > 2. security/access/class
>>
>> Take a look at:
>> http://cwiki.apache.org/qpid/qpid-design-authentication.html which I
>> think covers this.
>>
>> RG
>>
>



-- 
Martin Ritchie

Re: Need to understand the purpose of certain elements in config.xml

Posted by Robert Greig <ro...@gmail.com>.
2008/5/21 Robert Godfrey <ro...@gmail.com>:

> 0-8/0-9 Specify that every queue that is created should be
> automatically bound to the "no-name" exchange; which is a direct
> exchange.  This behaviour is still mandated in 0-10.  This config file
> option (when set to true) provides this AMQP compliant behaviour :-)

Gah.

> I *think* that the intention is to allow for a simplified model for
> those that do not wish to understand the concept of exchanges.

I still say that this can be done perfectly well in the API, not the protocol.

RG

Re: Need to understand the purpose of certain elements in config.xml

Posted by Robert Godfrey <ro...@gmail.com>.
2008/5/21 Robert Greig <ro...@gmail.com>:
> 2008/5/20 Senaka Fernando <se...@gmail.com>:
>
>>    <heartbeat>
>>        <delay>0</delay>
>>        <timeoutFactor>2.0</timeoutFactor>
>>    </heartbeat>
>
> This controls the heartbeat settings, that are used to detect client
> failures. A non-zero value specifies the time between heartbeats (I'm
> guessing the units are seconds but you may want to check that). The
> timeout factor specifies the multiple of the delay that is allow to
> pass without receiving a heartbeat before the client is considered
> dead. For example, if the heartbeat delay was 10 seconds and the
> factor 2.0, then after 20 seconds the client would be considered dead.
>
>>    <queue>
>>        <auto_register>true</auto_register>
>>    </queue>
>
> This is an interesting one. If specifies whether queues get
> automatically bound to the direct exchange when declared. Rob - is
> this actually specified in the 0-9 protocol now? If it is then
> obviously it should be removed as an option.

0-8/0-9 Specify that every queue that is created should be
automatically bound to the "no-name" exchange; which is a direct
exchange.  This behaviour is still mandated in 0-10.  This config file
option (when set to true) provides this AMQP compliant behaviour :-)

> The reason this is an option was to make it compatible with openamq. I
> strongly objected to that behaviour at the time, since it was only
> introduced because that product had an API that mirrored the protocol.
> I believed at the time, and still do for that matter, that it was done
> for the wrong reasons - because someone viewed the protocol as an API
> and wanted to provide some syntactic sugar.

I *think* that the intention is to allow for a simplified model for
those that do not wish to understand the concept of exchanges.

-- Rob

Re: Need to understand the purpose of certain elements in config.xml

Posted by Robert Greig <ro...@gmail.com>.
2008/5/20 Senaka Fernando <se...@gmail.com>:

>    <heartbeat>
>        <delay>0</delay>
>        <timeoutFactor>2.0</timeoutFactor>
>    </heartbeat>

This controls the heartbeat settings, that are used to detect client
failures. A non-zero value specifies the time between heartbeats (I'm
guessing the units are seconds but you may want to check that). The
timeout factor specifies the multiple of the delay that is allow to
pass without receiving a heartbeat before the client is considered
dead. For example, if the heartbeat delay was 10 seconds and the
factor 2.0, then after 20 seconds the client would be considered dead.

>    <queue>
>        <auto_register>true</auto_register>
>    </queue>

This is an interesting one. If specifies whether queues get
automatically bound to the direct exchange when declared. Rob - is
this actually specified in the 0-9 protocol now? If it is then
obviously it should be removed as an option.

The reason this is an option was to make it compatible with openamq. I
strongly objected to that behaviour at the time, since it was only
introduced because that product had an API that mirrored the protocol.
I believed at the time, and still do for that matter, that it was done
for the wrong reasons - because someone viewed the protocol as an API
and wanted to provide some syntactic sugar.

RG

Re: Need to understand the purpose of certain elements in config.xml

Posted by Senaka Fernando <se...@gmail.com>.
Hi again,

I would like to know what these options mean too.

    <heartbeat>
        <delay>0</delay>
        <timeoutFactor>2.0</timeoutFactor>
    </heartbeat>
    <queue>
        <auto_register>true</auto_register>
    </queue>

Thanks,
Senaka

On Tue, May 20, 2008 at 6:39 PM, Senaka Fernando <se...@gmail.com>
wrote:

> Hi Robert,
>
> It makes sense not to have these in the default config file that gets
> shipped but to have it elsewhere for the benefit of the devs.
>
> Regards,
> Senaka
>
>
> On Tue, May 20, 2008 at 6:35 PM, Robert Greig <ro...@gmail.com>
> wrote:
>
>> 2008/5/20 Senaka Fernando <se...@gmail.com>:
>>
>> > Thanks for the detail. However, I believe that this might not be
>> required to
>> > be a part of the README. However, this provides an excellent basis for
>> > discussing there purpose. I would like to know why "filterchain
>> > enableExecutorPool="true"/>" is present if it never should be false?
>>
>> It' just historical. Very early on a lot of MINA things were made
>> configurable to enable us to test different combinations easily. Some
>> of these things have turned out to be things you never really change
>> but the configurability was never removed.
>>
>> Note that all these things have (sensible I hope!) defaults so there
>> is no need for these to be in the default config file shipped to
>> users. It is nice to have a config file somewhere with every single
>> option in it though, even just as an aid to us!
>>
>> RG
>>
>
>

Re: Need to understand the purpose of certain elements in config.xml

Posted by Senaka Fernando <se...@gmail.com>.
Hi Robert,

It makes sense not to have these in the default config file that gets
shipped but to have it elsewhere for the benefit of the devs.

Regards,
Senaka

On Tue, May 20, 2008 at 6:35 PM, Robert Greig <ro...@gmail.com>
wrote:

> 2008/5/20 Senaka Fernando <se...@gmail.com>:
>
> > Thanks for the detail. However, I believe that this might not be required
> to
> > be a part of the README. However, this provides an excellent basis for
> > discussing there purpose. I would like to know why "filterchain
> > enableExecutorPool="true"/>" is present if it never should be false?
>
> It' just historical. Very early on a lot of MINA things were made
> configurable to enable us to test different combinations easily. Some
> of these things have turned out to be things you never really change
> but the configurability was never removed.
>
> Note that all these things have (sensible I hope!) defaults so there
> is no need for these to be in the default config file shipped to
> users. It is nice to have a config file somewhere with every single
> option in it though, even just as an aid to us!
>
> RG
>

Re: Need to understand the purpose of certain elements in config.xml

Posted by Robert Greig <ro...@gmail.com>.
2008/5/20 Senaka Fernando <se...@gmail.com>:

> Thanks for the detail. However, I believe that this might not be required to
> be a part of the README. However, this provides an excellent basis for
> discussing there purpose. I would like to know why "filterchain
> enableExecutorPool="true"/>" is present if it never should be false?

It' just historical. Very early on a lot of MINA things were made
configurable to enable us to test different combinations easily. Some
of these things have turned out to be things you never really change
but the configurability was never removed.

Note that all these things have (sensible I hope!) defaults so there
is no need for these to be in the default config file shipped to
users. It is nice to have a config file somewhere with every single
option in it though, even just as an aid to us!

RG

Re: Need to understand the purpose of certain elements in config.xml

Posted by Senaka Fernando <se...@gmail.com>.
Hi Robert,

Thanks for the detail. However, I believe that this might not be required to
be a part of the README. However, this provides an excellent basis for
discussing there purpose. I would like to know why "filterchain
enableExecutorPool="true"/>" is present if it never should be false?

Hi devs,

I will modify the README as required considering various suggestions made by
Martin regarding the "advanced" section of the config.xml.

I'm attaching herewith the partially completed version. Please do let me
know of any improvements that can be done.

Thanks,
Senaka

On Tue, May 20, 2008 at 6:05 PM, Robert Greig <ro...@gmail.com>
wrote:

> 2008/5/20 Senaka Fernando <se...@gmail.com>:
>
> > Thanks for the valuable guidelines. I'm almost done writing the README
> for
> > the config.xml.
>
> Great work!
>
> > However, I'm yet to understand the,
> >
> >    <advanced>
> >        <filterchain enableExecutorPool="true"/>
> >        <enablePooledAllocator>false</enablePooledAllocator>
> >        <enableDirectBuffers>false</enableDirectBuffers>
> >        <framesize>65535</framesize>
> >        <compressBufferOnQueue>false</compressBufferOnQueue>
> >        <enableJMSXUserID>false</enableJMSXUserID>
> >    </advanced>
> >
> > section. As it seems it is a bit advanced to figure out. :)...
>
> OK, from the top - many of these are actually MINA specific - if
> anyone spots that I am talking nonsense please jump in and correct me:
>
> enableExecutorPool specifies whether to add a threadpool filter to the
> filterchain - basically means that the I/O is done in a separate
> thread from the processing. This really should never be set to false.
>
> pooled allocator means that MINA will pool byte buffers. Testing has
> shown that this counterproductive when using heap buffers (see next
> point)
>
> direct buffers are the NIO direct byte buffers - as opposed to heap
> buffers. In theory they are supposed to be faster but on the operating
> systems and JVMs that we have tested (RHEL 3 and 4, sun and BEA) we
> find that heap buffers are better. YMMV.
>
> framesize - the maximum framesize the broker will use for AMQP frames.
> Messages bigger than this size will be fragmented into frames of this
> size. It may be worth increasing the size to increase throughput if
> you send messages a little bit bigger than this but obviously this
> needs careful testing etc etc
>
> compressBufferOnQueue - by default, for performance, byte buffers
> representing data read off the network are not compressed. This is
> sensible if the data is just about to go straight out to a client.
> However it does mean that the memory usage will be high (see the
> comments earlier about the socket buffer sizes) so setting this to
> true should reduce memory usage particularly if you have slow clients.
>
> JMSXUserId - no idea I'm afraid.
>
> > Also, there are two elements configuring virtualhosts. I would like to
> know
> > how this works out.
>
> Anything specific?
>
> Not sure myself about the virtualhosts directory - is it perhaps where
> to look for the virtualhosts xml files?
>
> RG
>

Re: Need to understand the purpose of certain elements in config.xml

Posted by Robert Greig <ro...@gmail.com>.
2008/5/20 Senaka Fernando <se...@gmail.com>:

> Thanks for the valuable guidelines. I'm almost done writing the README for
> the config.xml.

Great work!

> However, I'm yet to understand the,
>
>    <advanced>
>        <filterchain enableExecutorPool="true"/>
>        <enablePooledAllocator>false</enablePooledAllocator>
>        <enableDirectBuffers>false</enableDirectBuffers>
>        <framesize>65535</framesize>
>        <compressBufferOnQueue>false</compressBufferOnQueue>
>        <enableJMSXUserID>false</enableJMSXUserID>
>    </advanced>
>
> section. As it seems it is a bit advanced to figure out. :)...

OK, from the top - many of these are actually MINA specific - if
anyone spots that I am talking nonsense please jump in and correct me:

enableExecutorPool specifies whether to add a threadpool filter to the
filterchain - basically means that the I/O is done in a separate
thread from the processing. This really should never be set to false.

pooled allocator means that MINA will pool byte buffers. Testing has
shown that this counterproductive when using heap buffers (see next
point)

direct buffers are the NIO direct byte buffers - as opposed to heap
buffers. In theory they are supposed to be faster but on the operating
systems and JVMs that we have tested (RHEL 3 and 4, sun and BEA) we
find that heap buffers are better. YMMV.

framesize - the maximum framesize the broker will use for AMQP frames.
Messages bigger than this size will be fragmented into frames of this
size. It may be worth increasing the size to increase throughput if
you send messages a little bit bigger than this but obviously this
needs careful testing etc etc

compressBufferOnQueue - by default, for performance, byte buffers
representing data read off the network are not compressed. This is
sensible if the data is just about to go straight out to a client.
However it does mean that the memory usage will be high (see the
comments earlier about the socket buffer sizes) so setting this to
true should reduce memory usage particularly if you have slow clients.

JMSXUserId - no idea I'm afraid.

> Also, there are two elements configuring virtualhosts. I would like to know
> how this works out.

Anything specific?

Not sure myself about the virtualhosts directory - is it perhaps where
to look for the virtualhosts xml files?

RG

Re: Need to understand the purpose of certain elements in config.xml

Posted by Senaka Fernando <se...@gmail.com>.
Hi again,

Thanks for the valuable guidelines. I'm almost done writing the README for
the config.xml. However, I'm yet to understand the,

    <advanced>
        <filterchain enableExecutorPool="true"/>
        <enablePooledAllocator>false</enablePooledAllocator>
        <enableDirectBuffers>false</enableDirectBuffers>
        <framesize>65535</framesize>
        <compressBufferOnQueue>false</compressBufferOnQueue>
        <enableJMSXUserID>false</enableJMSXUserID>
    </advanced>

section. As it seems it is a bit advanced to figure out. :)...

Also, there are two elements configuring virtualhosts. I would like to know
how this works out. And, I would also like to understand what
<directory>${conf}/virtualhosts</directory> actually points to.

Regards,
Senaka

On Tue, May 20, 2008 at 5:37 PM, Robert Greig <ro...@gmail.com>
wrote:

> 2008/5/20 Senaka Fernando <se...@gmail.com>:
> > Hi Robert,
> >
> > Thanks for the reply. I would like to know whether
> > <transport>nio</transport> is deprecated and, the meanings of
>
> Well, at one time we had another (non-nio) transport but it wasn't any
> faster so it probably got removed. At the moment it's the only option
> but that does not preclude a new one in future of course,
>
> > 1. security/principal-databases/principal-database/class
> > 2. security/access/class
>
> Take a look at:
> http://cwiki.apache.org/qpid/qpid-design-authentication.html which I
> think covers this.
>
> RG
>

Re: Need to understand the purpose of certain elements in config.xml

Posted by Robert Greig <ro...@gmail.com>.
2008/5/20 Senaka Fernando <se...@gmail.com>:
> Hi Robert,
>
> Thanks for the reply. I would like to know whether
> <transport>nio</transport> is deprecated and, the meanings of

Well, at one time we had another (non-nio) transport but it wasn't any
faster so it probably got removed. At the moment it's the only option
but that does not preclude a new one in future of course,

> 1. security/principal-databases/principal-database/class
> 2. security/access/class

Take a look at:
http://cwiki.apache.org/qpid/qpid-design-authentication.html which I
think covers this.

RG

Re: Need to understand the purpose of certain elements in config.xml

Posted by Senaka Fernando <se...@gmail.com>.
Hi Robert,

Thanks for the reply. I would like to know whether
<transport>nio</transport> is deprecated and, the meanings of

1. security/principal-databases/principal-database/class
2. security/access/class

Thanks,
Senaka

On Tue, May 20, 2008 at 3:58 AM, Robert Greig <ro...@gmail.com>
wrote:

> 2008/5/19 Senaka Fernando <se...@gmail.com>:
>
> > 1. what does sslOnly = true do?
>
> Only listen on the ssl port, not the non-ssl port too.
>
> > 2. what does qpidnio = true do?
>
> This is admittedly a poor name for the feature. This installs a
> multithreaded MINA socket acceptor that in was an attempt to boost the
> performance by allowing simultaneously reading from and writing to a
> socket. I am not sure how successful this is in all cases and perhaps
> Martin Ritchie (who wrote it) can provide more in depth guidance about
> how it performs in different scenarios.
>
> > 4. need to know about socketReceiveBuffer, socketSendBuffer size usage
> > (valid range etc.)
>
> This is the standard socket send and receive buffers.
>
> > 5. what's protectio all about.
>
> This limits the amount of data read from a particular client into a
> pending queue (or put into a pending queue to be written out) in order
> to "protect" the broker from running out of memory due to runaway
> clients or unresponsive clients (depending on the particular
> scenario).
>
> RG
>

Re: Need to understand the purpose of certain elements in config.xml

Posted by Robert Greig <ro...@gmail.com>.
2008/5/19 Senaka Fernando <se...@gmail.com>:

> 1. what does sslOnly = true do?

Only listen on the ssl port, not the non-ssl port too.

> 2. what does qpidnio = true do?

This is admittedly a poor name for the feature. This installs a
multithreaded MINA socket acceptor that in was an attempt to boost the
performance by allowing simultaneously reading from and writing to a
socket. I am not sure how successful this is in all cases and perhaps
Martin Ritchie (who wrote it) can provide more in depth guidance about
how it performs in different scenarios.

> 4. need to know about socketReceiveBuffer, socketSendBuffer size usage
> (valid range etc.)

This is the standard socket send and receive buffers.

> 5. what's protectio all about.

This limits the amount of data read from a particular client into a
pending queue (or put into a pending queue to be written out) in order
to "protect" the broker from running out of memory due to runaway
clients or unresponsive clients (depending on the particular
scenario).

RG