<docbook><section><title>MultipleRequestBrokers</title><bridgehead class="http://www.w3.org/1999/xhtml:h3">Multiple Request Brokers</bridgehead>
<para>There are now three different behaviors for running the broker under Windows that are affected by the type of Windows operating system, and the +foreground and +debug flags.</para><bridgehead class="http://www.w3.org/1999/xhtml:h4">METHOD 1 - As a service</bridgehead>
<para>When:</para><itemizedlist mark="bullet" spacing="compact"><listitem> Under NT/XP/2000, when no +foreground or +debug has been specified.
 The oplrqb service will start, but only if it has been registered.
 When no +instance is specified, it will use the default instance.
 If this fails, it will run as method 2 or 3.</listitem>
</itemizedlist><itemizedlist mark="bullet" spacing="compact"><listitem> Under NT/2000, with a +service start [+instance identifier] If this fails, it will exit with an error.</listitem>
</itemizedlist><programlisting>Note 1:

When starting oplrqb without options, it will attempt to auto start an existing service. if that fails, it will attempt methods 2 and 3 (see below)
</programlisting><para> </para><programlisting>Note 2:

You&#39;ll need to do +service create first, the broker doesn&#39;t do this by itself.
</programlisting><para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h4">METHOD 2 - With debugging console</bridgehead>
<para>When:</para><itemizedlist mark="bullet" spacing="compact"><listitem> with +foreground or +debug, started from explorer/dos box</listitem>
</itemizedlist><itemizedlist mark="bullet" spacing="compact"><listitem> without +foreground or +debug option, started from a dos box.</listitem>
</itemizedlist><programlisting>Note:

Start up mode is different when launched from a dos box. If there are no command line options specified, the broker will now default to +debug when started in a dos box.

the +foreground and +debug options take precedence over method 1 (starting the service)
</programlisting><para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h4">METHOD 3 - User Specific Service (characterized by a Services Tray Icon)</bridgehead>
<para>When:</para><itemizedlist mark="bullet" spacing="compact"><listitem> started from explorer, without +foreground/+debug (NT/XP/2000: Method 1 is tried first)</listitem>
</itemizedlist><programlisting>Note:

It will attempt to locate oplrqb.ini in the current directory, unless +config file has been specified.
</programlisting><para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h4">Startup Mode Summary</bridgehead>
<para>To summarize, here is some pseudo code:</para><programlisting>if OS = NT or OS = Win2000 or OS = XP then
  if no +foreground or +debug options then
    if there is a service installed then
      silently attempt to start the service
      if this succeeds then exit
    endif
endif

if +foreground or +debug options then
  allocate a debugging console
  run in the foreground

else if started from a dos box then
  set +foreground and +debug
  allocate a debugging console
  run in the foreground

else
  create the splash window and assume tray behavior
endif

Note: it is possible to make the oplrqb service allocate a debugging
console. To do this, specify +debug while creating the service
(example: oplrqb +service create +debug)
</programlisting><para> </para><bridgehead class="http://www.w3.org/1999/xhtml:h4">Multiple Service Instances</bridgehead>
<para>Multiple instances of the broker work only for NT/XP/2000 when running as a service.</para><para>There is one default instance (unnamed) which is used when no +instance command line flag has been specified.</para><para>examples:</para><programlisting>oplrqb +service create
</programlisting><para> Registers the default service instance.
 This service will use the oplrqb.ini rulebook in the current directory</para><programlisting>oplrqb +service create +instance 1 +config f:\openlink
</programlisting><para> Registers the oplrqb_1 service instance This service will use the oplrqb.ini rulebook in f:\openlink</para><programlisting>oplrqb +service create +config f:\openlink\test\debug.ini +debug
</programlisting><para> Registers the default service instance.
 This service will use the debug.ini rulebook in f:\openlink\test This service will produce debug output in a console.
 This service will not auto start, use oplrqb +service start</para><para>Other service commands:</para><programlisting>  +service auto [+instance id]    Set start up type to Automatic
  +service manual [+instance id]  Set start up type to Manual
  +service start [+instance id]   Start up the service
  +service stop [+instance id]    Stops up the service
  +service delete [+instance id]  Unregisters up the service
</programlisting><para> +service list has been extended to show the rulebook that the instance uses as well as other status information.</para><para>To configure another Broker instance manually:</para><itemizedlist mark="bullet" spacing="compact"><listitem> create a new directory</listitem>
</itemizedlist><itemizedlist mark="bullet" spacing="compact"><listitem> create a new rulebook in this directory</listitem>
</itemizedlist><itemizedlist mark="bullet" spacing="compact"><listitem> set BinaryDirectory in this new rulebook to the installation directory of oplrqb.exe (need to share binaries &amp; licensing)</listitem>
</itemizedlist><itemizedlist mark="bullet" spacing="compact"><listitem> Specify a different Listen port</listitem>
</itemizedlist><itemizedlist mark="bullet" spacing="compact"><listitem> Either disable www_sv in the rulebook or create a new www_sv.ini with &#39;HttpPort&#39; key value set to a unique value other than the default 8000.</listitem>
</itemizedlist><itemizedlist mark="bullet" spacing="compact"><listitem> create another entry using +instance <span style="color: red">
      UNKNOWN tag:
      http://www.w3.org/1999/xhtml:id +config  </span></listitem>
</itemizedlist></section></docbook>