Powered by Zoomin Software. For more details please contactZoomin

Semaphore Publisher

HTTP Callout Notifier

  • Last Updated: June 23, 2026
  • 3 minute read
    • Semaphore
    • Documentation

If you would like the Publisher to notify an external HTTP server that a publish event has occurred, you can use the HTTP Callout Notifier. By adding it to the output processor list of any of the configuration sets in your configuration file, you tell the publisher to make an HTTP GET request as part of the publish lifecycle. Regardless of where the bean is placed in the list of output processors, a commit-phase call is made after any rulebases have been published and the new SES index has been activated. As of release 5.10.4, the notifier can also fire at the init phase, before the expensive model load runs, so that a non‑2xx response aborts the publish with no SES / Solr / Git side effects.

Note: The <MODEL_VERSION> substitution token, the callOnInit / callOnCommit flags, and the connectTimeoutMs / socketTimeoutMs properties described below are available from Semaphore Publisher 5.10.4 onward.

An example configuration is presented in the /resources/import/AdditionalExamples file.

<bean id="HttpCalloutNotifier"
    class="com.smartlogic.publisher.notification.HttpCalloutNotifier">
    <property name="urlTemplate" value="http://hostname/fullPathToNotificationService?version=&lt;MODEL_VERSION&gt;" />
    <property name="dateParameter" value="date" />
    <property name="idParameter" value="id" />
    <property name="additionalParameters">
        <map>
            <entry key="modelversion" value="&lt;MODEL_VERSION&gt;" />
        </map>
    </property>
    <property name="headers">
        <map>
            <entry key="Cookie" value="JSESSIONID=C26A83AB1991234567E8C10EA36" />
        </map>
    </property>
</bean>

Substitution tokens

The urlTemplate and any value inside additionalParameters are scanned for the following tokens:

Token Replaced with Available at
<CHANGE_ID> The change ID being published Commit phase only
<MODIFICATION_DATE> The last modification date of the change Commit phase only
<MODEL_VERSION> The model version reported by SemaphoreModel.getVersion() Both init and commit phases

Tokens whose value is not populated for the current phase resolve to the literal string NULL. For example, at the init phase <CHANGE_ID> and <MODIFICATION_DATE> always resolve to NULL, because change details are only known after the model has been loaded.

If the dateParameter property is provided, the modification date is also added to the request using that property name. If the idParameter property is provided, the change ID is added using that property name. Additional query parameters can be supplied through additionalParameters; they are merged with any query string already present in urlTemplate (the URI builder uses ? when no query is present and & otherwise).

Init-phase pre-publish gate

By default, the notifier fires only at the commit phase (callOnCommit=true, callOnInit=false), preserving the historical behaviour. Setting callOnInit=true makes the notifier fire from init() — that is, before the model is loaded and before any SES, Solr, or Git work is performed. If the endpoint returns a non‑2xx status, the publish aborts immediately and no side effects are produced. This is useful as a pre-publish authorization or version-validation gate.

You can use the two flags independently:

  • callOnInit=true, callOnCommit=false — fire only at init (gate-only).
  • callOnInit=false, callOnCommit=true — fire only at commit (the default, post-publish notification).
  • callOnInit=true, callOnCommit=true — fire at both phases.

Two notifier beans can be wired in the same publisher configuration with different URLs, for example one acting as the init-phase gate and the other reporting commit success to a different endpoint.

<!-- Pre-publish gate: fires at init, before model.load() runs. -->
<bean id="HttpCalloutNotifierInitGate"
    class="com.smartlogic.publisher.notification.HttpCalloutNotifier">
    <property name="urlTemplate" value="http://localhost:9090/validate?version=&lt;MODEL_VERSION&gt;" />
    <property name="callOnInit" value="true" />
    <property name="callOnCommit" value="false" />
    <property name="connectTimeoutMs" value="10000" />
    <property name="socketTimeoutMs" value="30000" />
</bean>

HTTP timeouts

Two integer properties control the timeouts applied to the underlying Apache HTTP client. Both values are in milliseconds; 0 means infinite.

Property Default Description
connectTimeoutMs 10000 Time to establish the TCP connection to the endpoint.
socketTimeoutMs 30000 Time to wait between bytes once the connection is established (read timeout).

Configuring sensible timeouts protects the publisher from hanging indefinitely against a misconfigured or slow callout endpoint.

TitleResults for “How to create a CRG?”Also Available inAlert