Event Fowarding URL - syntax

bbollard22 days ago

Hello, I am trying to forward position events on Windows 6.8.1 as such:

    <entry key='forward.enable'>true</entry>
    <entry key='forward.url'>http://127.0.0.1:8085?name={name}&id={uniqueId}&lat={latitude}&lon={longitude}</entry>
    <entry key='forward.type'>url</entry>

However, when the service starts it crashes without any log file entries to troubleshoot.

Changing the forward.url to a single parameter to troubleshoot works:

    <entry key='forward.enable'>true</entry>
    <entry key='forward.url'>http://127.0.0.1:8085?name={name}</entry>
    <entry key='forward.type'>url</entry>

also, specifying another querystring parameter that my end point will consume doesn't work:

<entry key='forward.url'>http://127.0.0.1:8085?myparm=xyz&name={name}</entry>

Is there more detailed documentation on how to leverage this feature, the full list of tokens available, etc.

Thank you,
Brian

Anton Tananaev22 days ago

That's because you need to escape some characters in XML.

bbollard22 days ago

Doh! Thank you.

Is there a list of all available tokens available?

Anton Tananaev22 days ago
bbollard22 days ago

Awesome. So using that I set this:

    <entry key='forward.enable'>false</entry>
    <entry key='forward.url'>http://127.0.0.1:8085?name={name}&amp;id={uniqueId}&amp;lat={latitude}&amp;lon={longitude}&amp;address={address}&amp;statuscode={statusCode}&amp;speed={speed}&amp;timestamp={fixtime}&amp;protocol={protocol}&amp;speed={speed}&amp;course={course}&amp;accuracy={accuracy}</entry>
    <entry key='forward.type'>url</entry>

No positions are being forwarded.

The log is showing this failure:

2025-07-19 13:22:54  WARN: Position handler failed - The template variable 'address' has no value - IllegalArgumentException (... < PositionForwarderUrl:56 < PositionForwardingHandler:81 < *:132 < BasePositionHandler:34 < ProcessingHandler:173 < ...)

The source code you mention has this logic:

if (position.getAddress() != null) {
            request = request.replace(
                    "{address}", URLEncoder.encode(position.getAddress(), StandardCharsets.UTF_8));
        }

So if it is unable to set this token, is it the intent to fail the forwarding event entirely? Or should it pass an http friendly null representation?

Anton Tananaev22 days ago

It will fail in some cases. Address is one of them.

bbollard22 days ago

I understand that there will be times that no address can be calculated. My concern is in those cases the position forwarding fails entirely instead of just failing to set the address. Is that the design?

Anton Tananaev22 days ago

Probably not ideal. But I wouldn't recommend using URL query format in general.

bbollard22 days ago

Agreed. But I didn't see a mechanism to perform a POST with a JSON body or something similar. Did I miss that in the docs somewhere?

Anton Tananaev22 days ago

Set the type to "json".