my aplication currently has a windows gui where i klick a start button.
than one procedure after another is executed.
at the beginning of each procedure a text ist displayed in a list control.
so the user can see which process currently is running.
i want to implement this workflow in mediator.
a mediator sequence is startet from my application and it should return its current progress to the application to monitor the execution of the sequence.
how could/should i implement this ?
There is probably no simple way to accomplish this. If you start your Mediator sequence via HTTP you can only get one HTTP response message. If you start it vis JMS, then your sequence could send multiple JMS messages to your reply-to destination and those could be displayed to indicate progress.
Is your Mediator sequence a long-running one?
Hope this helps.
Thx for your suggestion.
Isn’t it possible to use HttpGateway Components to accomplish this too ?
properties set to: xbd.http.method=“POST” xbd.http.target.url="http://localhost:5050
the sequence contains f.e. 5 HttpGateways.
on my local machine i implement a simple service listening on port 5050.
the whole workflow is long running (about 1 hour), but one sequence is rather short - this sequence is executet many times.
a key requirement is, that the execution must be monitored.
(like it is done in existing tools - for example in biztalk server)
simplified: a customer must know, what a workflow is currently doing.
i prefer a more “general” approach doing this, that doesn’t depend on java, cause i can’t expect the client to hava java installed, like http or soap responses from my sequnece.
Do you think, it is reasonable/possible using the HttpGateway to respond to a local installed service?
thx in advance
You could certainly do this, and implement some sort of event list in your servlet at could be queried bu other applications.
ok, i have done this and implementet a simple webserver in C#, that listens on port 5050.
from another application i start the following mediator sequence:
<?xml version="1.0" encoding="UTF-8"?>
The first time i run the sequence anything seems fine - except the payload is not contained in my second http response:
The sequence runns from “First Logger” to “Final Logger”. (listed in the “DefaultComponentFactory.Message.log”)
When i start the sequence a second time, i have the problem, that the execution of the sequence stopps after the first http-gateway.
Message ID = 97d01f~1021fd4c0dd
Time = 2005-02-17 16:38:53.726
Original Message ID = 97d01f~1021fd4c0dd
Sequence Line = 5, Statement = step
Sequence URL = http://localhost:8080/slide/files/MediatorRepository/test/MonitoringTest.xml
xbd.logger.message = First Logger
---- Properties -----
xbd.current.contentID = /97d01f~1021fd4c0dd
xbd.current.contentID.URL = cid:/97d01f~1021fd4c0dd
xbd.factory.arrival = 2005-02-17 16:38:53.647
xbd.factory.name = DefaultComponentFactory
xbd.gatewayservlet.request.content-length = 119
xbd.gatewayservlet.request.content-type = text/xml; charset=utf-8
xbd.gatewayservlet.request.expect = 100-continue
xbd.gatewayservlet.request.host = localhost:8080
xbd.persist.message = false
xbd.persist.overwrite = no
xbd.persist.status = false
xbd.portal.client.address = 127.0.0.1
xbd.portal.client.host = 127.0.0.1
xbd.portal.method = POST
xbd.portal.type = HTTP
xbd.resource.cache = false
----- Content Headers -----
Content-Type = text/xml; charset=UTF-8
Content-Length = 119
Message-ID = 97d01f~1021fd4c0dd
Content-ID = </97d01f~1021fd4c0dd
----- Content -----
<?xml version='1.0' encoding='UTF-8'?>testautor12345
in the <DefaultComponentFactory.xbd.log> file i find the following entry:
[slf5s.start]17 Feb 2005 16:38:53,741[slf5s.DATE] Thread-4[slf5s.THREAD] ERROR[slf5s.PRIORITY] xbd[slf5s.CATEGORY] - SagSequencer - SEQUENCER ERROR: sequence “http://localhost:8080/slide/files/MediatorRepository/test/MonitoringTest.xml”, line 7, : com.softwareag.xbridge.exceptions.XException: httpReceive: java.net.SocketException: Connection reset[slf5s.MESSAGE]
com.softwareag.xbridge.exceptions.XException: httpReceive: java.net.SocketException: Connection reset
from now, the sequence never posts http-requests anymore - i always get this execption.
i wonder, why it worked the first time, returned no payload the second time and after the first run of the entire sequence doesn’t work anymore?
eventually the problem is the following:
entry in the logfile:
xbd.pstore.error.information = Sequencer detected error :com.softwareag.xbridge.exceptions.XException: httpReceive: java.net.SocketException: Connection reset
can it be, that mediator expects, that a once created http-connection (in the first http-gateway) can be used in a second request. (f.e. a second http-gateway), but the component monitoring the requests always uses a new connection.
i think, this can be solved by setting th http-property “Connection: Keep-Alive” to “Connection: Close” - how can this be done in mediator ?
The Mediator’s HTTPGateway always closes the connection streams after each message. There is currently no way to influence this behavior.
You might consider using HTTP PUT instead of POST if you are not expecting your server to return a modified message. For PUT, the HTTPGateway sends the payload but does not receive a response payload.
many thx for your help !!
i changed the method to “PUT” an finally it worked.
i had to change some other things too (also use “put” to send the initiate sequence command to mediator), reply status 200 (o.k.) to the http gateway from my webserver and so on.
but finally it works an i can now monitor a sequence asynchronously.
to monitor “custom” messages, i use the “http-request” field.