Asynchronous XPL processing

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Asynchronous XPL processing

mob-2
Hello,

I have some longer running and server resource intensive pipelines whose execution I would like to serialize - meaning that parallel requests from users should be serially executed.
Can someone give me some hints how this could be best achieved with the least number of non-orbeon components ?

regards,
Bal¨¢zs



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Asynchronous XPL processing

Erik Bruchez
Administrator
One way would be to execute them through a "service" (through HTTP)
listening on a Tomcat connector. Such connectors allow you to queue and
limit the number of incoming requests. You could this way serialize
their execution.

-Erik

[hidden email] wrote:
> Hello,
>
> I have some longer running and server resource intensive pipelines whose execution I would like to serialize - meaning that parallel requests from users should be serially executed.
> Can someone give me some hints how this could be best achieved with the least number of non-orbeon components ?
>
> regards,
> Bal¨¢zs




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Combining two processors two one output

Mikko Wuokko
Hi.

This could be quite trivial, but I'm rather new to this xpl/page-flow
stuff and just can't figure out this myself.

The thing is that I got two processors, one fetching data from ldap and
one from sql. I use now one .xsl file to present the results. It works
fine if I use just one of them at time and when the output from the
processor is named "data" and the ref is "data" as well. With two it
doesn't work because you can only have output with reference to data. I
should probably something like id instead of ref, but how do I reference
the outputs from the two processors in the .xsl file? Am I totally lost
here?

The processors are like these

<p:processor name="oxf:ldap" xmlns:p="http://www.orbeon.com/oxf/pipeline">
     <p:input name="config">
         <config>
             <host>localhost</host>
             <port>389</port>
             <bind-dn>uid=admin,ou=system</bind-dn>
             <password>secret</password>
             <root-dn>o=sevenSeas</root-dn>
             <attribute>sn</attribute>
             </config>
         </p:input>
     <p:input name="filter">
         <!-- Must use entities on search string eg. & => &amp; -->
         <filter>(sn=*)</filter>
         </p:input>
     <p:output name="data" ref="data" />
</p:processor>

<p:processor name="oxf:sql" xmlns:sql="http://orbeon.org/oxf/xml/sql">
     <p:input name="config">
         <sql:config xmlns:sql="http://orbeon.org/oxf/xml/sql">
             <result>
             <sql:connection>
                <!-- data source defined in tomcat -->
                <sql:datasource>users</sql:datasource>
                 <sql:execute>
                     <sql:query>
                         SELECT * FROM users WHERE <HERE THE FILTERS
FROM LDAP>
                     </sql:query>
                     <sql:result-set>
                         <sql:row-iterator>
                         <user>
                             <id>
                                 <sql:get-column-value type="xs:int"
column="id"/>
                             </id>
                             <username>
                                 <sql:get-column-value type="xs:string"
column="username"/>
                             </username>
                             <status>
                                 <sql:get-column-value type="xs:string"
column="status"/>
                             </status>
                         </user>
                         </sql:row-iterator>
                     </sql:result-set>
                 </sql:execute>
                 </sql:connection>
             </result>
             </sql:config>
         </p:input>
     <p:output name="data" ref="data" />
</p:processor>

Could someone point me to the right direction with this?

Thanks,

Mikko



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Combining two processors two one output

Greg Jones-2
Hi Mikko,

The best way would be to use the identity processor and the 'aggregate'
function to combine the two pipeline outputs into a single output. For
example, using your processors:

<p:param type="output" name="data"/>

<p:processor name="oxf:ldap" xmlns:p="http://www.orbeon.com/oxf/pipeline">
        .....
     <p:output name="data" id="ldap-results" />
</p:processor>

<p:processor name="oxf:sql" xmlns:sql="http://orbeon.org/oxf/xml/sql">
        ...
     <p:output name="data" id="sql-results" />
</p:processor>

<!-- Aggregate the data -->
<p:processor name="oxf:identity">
    <p:input name="data" href="aggregate('all-results',
                    #ldap-results, #sql-results)"/>
        <p:output name="data" ref="data"/>
    </p:processor>

The output from this aggregation is a single XML document with a root
element called 'all-results' and your result sets under that element.

See http://www.orbeon.com/ops/doc/processors-other#identity-processor for
all of the details.

Regards,
Greg Jones


-----Original Message-----
From: Mikko Wuokko [mailto:[hidden email]]
Sent: Monday, 13 February 2006 8:59 PM
To: [hidden email]
Subject: [ops-users] Combining two processors two one output

Hi.

This could be quite trivial, but I'm rather new to this xpl/page-flow
stuff and just can't figure out this myself.

The thing is that I got two processors, one fetching data from ldap and
one from sql. I use now one .xsl file to present the results. It works
fine if I use just one of them at time and when the output from the
processor is named "data" and the ref is "data" as well. With two it
doesn't work because you can only have output with reference to data. I
should probably something like id instead of ref, but how do I reference
the outputs from the two processors in the .xsl file? Am I totally lost
here?

The processors are like these

<p:processor name="oxf:ldap" xmlns:p="http://www.orbeon.com/oxf/pipeline">
     <p:input name="config">
         <config>
             <host>localhost</host>
             <port>389</port>
             <bind-dn>uid=admin,ou=system</bind-dn>
             <password>secret</password>
             <root-dn>o=sevenSeas</root-dn>
             <attribute>sn</attribute>
             </config>
         </p:input>
     <p:input name="filter">
         <!-- Must use entities on search string eg. & => &amp; -->
         <filter>(sn=*)</filter>
         </p:input>
     <p:output name="data" ref="data" />
</p:processor>

<p:processor name="oxf:sql" xmlns:sql="http://orbeon.org/oxf/xml/sql">
     <p:input name="config">
         <sql:config xmlns:sql="http://orbeon.org/oxf/xml/sql">
             <result>
             <sql:connection>
                <!-- data source defined in tomcat -->
                <sql:datasource>users</sql:datasource>
                 <sql:execute>
                     <sql:query>
                         SELECT * FROM users WHERE <HERE THE FILTERS
FROM LDAP>
                     </sql:query>
                     <sql:result-set>
                         <sql:row-iterator>
                         <user>
                             <id>
                                 <sql:get-column-value type="xs:int"
column="id"/>
                             </id>
                             <username>
                                 <sql:get-column-value type="xs:string"
column="username"/>
                             </username>
                             <status>
                                 <sql:get-column-value type="xs:string"
column="status"/>
                             </status>
                         </user>
                         </sql:row-iterator>
                     </sql:result-set>
                 </sql:execute>
                 </sql:connection>
             </result>
             </sql:config>
         </p:input>
     <p:output name="data" ref="data" />
</p:processor>

Could someone point me to the right direction with this?

Thanks,

Mikko




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Combining two processors two one output

Mikko Wuokko
Thanks for your quick reply, that did the trick.

-Mikko

Greg Jones wrote:

> Hi Mikko,
>
> The best way would be to use the identity processor and the 'aggregate'
> function to combine the two pipeline outputs into a single output. For
> example, using your processors:
>
> <p:param type="output" name="data"/>
>
> <p:processor name="oxf:ldap" xmlns:p="http://www.orbeon.com/oxf/pipeline">
>         .....
>      <p:output name="data" id="ldap-results" />
> </p:processor>
>
> <p:processor name="oxf:sql" xmlns:sql="http://orbeon.org/oxf/xml/sql">
>         ...
>      <p:output name="data" id="sql-results" />
> </p:processor>
>
> <!-- Aggregate the data -->
> <p:processor name="oxf:identity">
>     <p:input name="data" href="aggregate('all-results',
>                     #ldap-results, #sql-results)"/>
>         <p:output name="data" ref="data"/>
>     </p:processor>
>
> The output from this aggregation is a single XML document with a root
> element called 'all-results' and your result sets under that element.
>
> See http://www.orbeon.com/ops/doc/processors-other#identity-processor for
> all of the details.
>
> Regards,
> Greg Jones
>
>
> -----Original Message-----
> From: Mikko Wuokko [mailto:[hidden email]]
> Sent: Monday, 13 February 2006 8:59 PM
> To: [hidden email]
> Subject: [ops-users] Combining two processors two one output
>
> Hi.
>
> This could be quite trivial, but I'm rather new to this xpl/page-flow
> stuff and just can't figure out this myself.
>
> The thing is that I got two processors, one fetching data from ldap and
> one from sql. I use now one .xsl file to present the results. It works
> fine if I use just one of them at time and when the output from the
> processor is named "data" and the ref is "data" as well. With two it
> doesn't work because you can only have output with reference to data. I
> should probably something like id instead of ref, but how do I reference
> the outputs from the two processors in the .xsl file? Am I totally lost
> here?
>
> The processors are like these
>
> <p:processor name="oxf:ldap" xmlns:p="http://www.orbeon.com/oxf/pipeline">
>      <p:input name="config">
>          <config>
>              <host>localhost</host>
>              <port>389</port>
>              <bind-dn>uid=admin,ou=system</bind-dn>
>              <password>secret</password>
>              <root-dn>o=sevenSeas</root-dn>
>              <attribute>sn</attribute>
>              </config>
>          </p:input>
>      <p:input name="filter">
>          <!-- Must use entities on search string eg. & => &amp; -->
>          <filter>(sn=*)</filter>
>          </p:input>
>      <p:output name="data" ref="data" />
> </p:processor>
>
> <p:processor name="oxf:sql" xmlns:sql="http://orbeon.org/oxf/xml/sql">
>      <p:input name="config">
>          <sql:config xmlns:sql="http://orbeon.org/oxf/xml/sql">
>              <result>
>              <sql:connection>
>                 <!-- data source defined in tomcat -->
>                 <sql:datasource>users</sql:datasource>
>                  <sql:execute>
>                      <sql:query>
>                          SELECT * FROM users WHERE <HERE THE FILTERS
> FROM LDAP>
>                      </sql:query>
>                      <sql:result-set>
>                          <sql:row-iterator>
>                          <user>
>                              <id>
>                                  <sql:get-column-value type="xs:int"
> column="id"/>
>                              </id>
>                              <username>
>                                  <sql:get-column-value type="xs:string"
> column="username"/>
>                              </username>
>                              <status>
>                                  <sql:get-column-value type="xs:string"
> column="status"/>
>                              </status>
>                          </user>
>                          </sql:row-iterator>
>                      </sql:result-set>
>                  </sql:execute>
>                  </sql:connection>
>              </result>
>              </sql:config>
>          </p:input>
>      <p:output name="data" ref="data" />
> </p:processor>
>
> Could someone point me to the right direction with this?
>
> Thanks,
>
> Mikko
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws