You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Lionel Cons <li...@cern.ch> on 2011/06/21 09:11:22 UTC

Apollo schema validation

Hiram,

Now that Apollo has a working XSD file, it should (like ActiveMQ >= 5.4)
validate the apollo.xml file and refuse to use it unless it is valid.

Cheers,

Lionel

Re: Apollo schema validation

Posted by Lionel Cons <li...@cern.ch>.
Hiram Chirino writes:
 > Done.  You should add an validation='strict' attribute to the broker
 > element to auto stop a broker which has an XML file which has
 > validation errors.

Thanks for this.

However, in my test, Apollo appears to fail silently. I added a buggy
attribute to one element and I get:

# service apollo start
Starting apollo
apollo is now running (31974)

=> so apollo appears to have been started

# service apollo status
apollo is stopped

=> but it did not (i.e. it failed/stopped just after the "successful" start)

# ls -l log/*.log
-rw-r--r-- 1 apollo apollo 0 Jun 30 07:59 log/apollo.log
-rw-r--r-- 1 apollo apollo 0 Jun 30 07:59 log/connection.log
-rw-r--r-- 1 apollo apollo 0 Jun 30 07:59 log/security.log

=> there is nothing in the logs...

Is there a way to improve the start script so that such a failure is detected?

Is it possible to log something somewhere?

Cheers,

Lionel

Re: Apollo schema validation

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Done.  You should add an validation='strict' attribute to the broker
element to auto stop a broker which has an XML file which has
validation errors.

Regards,
Hiram

FuseSource
Web: http://fusesource.com/




On Tue, Jun 21, 2011 at 6:45 AM, Hiram Chirino <hi...@hiramchirino.com> wrote:
> Ok that sounds good to me:
>
> https://issues.apache.org/jira/browse/APLO-55
>
> Regards,
> Hiram
>
> FuseSource
> Web: http://fusesource.com/
>
>
>
>
> On Tue, Jun 21, 2011 at 6:35 AM, Lionel Cons <li...@cern.ch> wrote:
>> Hiram Chirino writes:
>>  > I'm not 100% sure I agree, with that.  Perhaps we should schema
>>  > validate and log error messages if problems were found, but if the XML
>>  > document is valid enough for us to parse it I think we should make our
>>  > best effort to start broker.
>>
>> Hiram,
>>
>> Personally, I prefer to be strict since I don't know if the valid part
>> (out of the complete XML) will make any sense or not.
>>
>> To please everybody, maybe this should be an option when starting the
>> broker?
>>
>> Cheers,
>>
>> Lionel
>>
>

Re: Apollo schema validation

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Ok that sounds good to me:

https://issues.apache.org/jira/browse/APLO-55

Regards,
Hiram

FuseSource
Web: http://fusesource.com/




On Tue, Jun 21, 2011 at 6:35 AM, Lionel Cons <li...@cern.ch> wrote:
> Hiram Chirino writes:
>  > I'm not 100% sure I agree, with that.  Perhaps we should schema
>  > validate and log error messages if problems were found, but if the XML
>  > document is valid enough for us to parse it I think we should make our
>  > best effort to start broker.
>
> Hiram,
>
> Personally, I prefer to be strict since I don't know if the valid part
> (out of the complete XML) will make any sense or not.
>
> To please everybody, maybe this should be an option when starting the
> broker?
>
> Cheers,
>
> Lionel
>

Re: Apollo schema validation

Posted by Lionel Cons <li...@cern.ch>.
Hiram Chirino writes:
 > I'm not 100% sure I agree, with that.  Perhaps we should schema
 > validate and log error messages if problems were found, but if the XML
 > document is valid enough for us to parse it I think we should make our
 > best effort to start broker.

Hiram,

Personally, I prefer to be strict since I don't know if the valid part
(out of the complete XML) will make any sense or not.

To please everybody, maybe this should be an option when starting the
broker?

Cheers,

Lionel

Re: Apollo schema validation

Posted by Hiram Chirino <hi...@hiramchirino.com>.
I'm not 100% sure I agree, with that.  Perhaps we should schema
validate and log error messages if problems were found, but if the XML
document is valid enough for us to parse it I think we should make our
best effort to start broker.


Regards,
Hiram

FuseSource
Web: http://fusesource.com/




On Tue, Jun 21, 2011 at 3:11 AM, Lionel Cons <li...@cern.ch> wrote:
> Hiram,
>
> Now that Apollo has a working XSD file, it should (like ActiveMQ >= 5.4)
> validate the apollo.xml file and refuse to use it unless it is valid.
>
> Cheers,
>
> Lionel
>