(This message has been automatically imported from the retired mailing list)
Hello,=20
I=E2=80=99m unable to make the invoke/retry to work.
I=E2=80=99ve created this calling service:
-- coding: utf-8 --
from future import absolute_import, division, print_function, =
unicode_literals
from zato.common import ZatoException
from zato.server.service.internal.helpers import Service
class MyService(Service):
def handle(self):
try:
# The service to invoke
target =3D 'retry-test.test-service'
# How many times to invoke it and how long to sleep between =
the calls
config =3D {
‘repeats’: 3,
‘seconds’: 10
}
# Call invoke/retry
response =3D self.patterns.invoke_retry.invoke(target, =
**config)
# Everything went fine in the end
self.logger.info('Response received %r', response)
# We enter here if all the invocations ended in an exception
except ZatoException, e:
self.logger.warn('Caught an exception %s', e.message)
and this is the target service:
-- coding: utf-8 --
from future import absolute_import, division, print_function, =
unicode_literals
from zato.server.service import Service
class TestService(Service):
def handle(self):
try:
self.logger.info('hello from Testservice')
self.response.payload =3D 'hola'
# raise ValueError('this will fail')
except ValueError:
self.logger.warn('Some error happened')
When I invoke the calling service, this is what I receive:
Could not invoke the service. name:[calling-retry-test.my-service], =
cluster_id:[1], e:[Traceback (most recent call last):
File =
"/opt/zato/2.0.5/zato-web-admin/src/zato/admin/web/views/service.py", =
line 546, in invoke
response =3D req.zato.client.invoke(name, **input_dict)
File “/opt/zato/2.0.5/zato-web-admin/src/zato/admin/middleware.py”, =
line 69, in invoke
response =3D super(Client, self).invoke(*args, =
headers=3D{‘X-Zato-Forwarded-For’: self.forwarder_for}, **kwargs)
File “/opt/zato/2.0.5/zato-client/src/zato/client/init.py”, line =
400, in invoke
return self._invoke(async=3DFalse, *args, **kwargs)
File “/opt/zato/2.0.5/zato-client/src/zato/client/init.py”, line =
397, in _invoke
return super(AnyServiceInvoker, self).invoke(dumps(request), =
ServiceInvokeResponse, async, headers, output_repeated)
File “/opt/zato/2.0.5/zato-client/src/zato/client/init.py”, line =
334, in invoke
return self.inner_invoke(request, response_class, async, headers)
File “/opt/zato/2.0.5/zato-client/src/zato/client/init.py”, line =
322, in inner_invoke
self.max_cid_repr, self.logger, output_repeated)
File “/opt/zato/2.0.5/zato-client/src/zato/client/init.py”, line =
243, in init
super(ServiceInvokeResponse, self).init(*args, **kwargs)
File “/opt/zato/2.0.5/zato-client/src/zato/client/init.py”, line =
82, in init
self.init()
File “/opt/zato/2.0.5/zato-client/src/zato/client/init.py”, line =
181, in init
raise ValueError(msg)
ValueError: inner.status_code 504
, JSON parsing error =
`
504 Gateway Time-out
The server didn’t respond in time. ` ] On the logs it seems to be calling the service or at least trying
2015-07-02 09:49:40,438 - INFO - zato.server.pattern.invoke_retry:22 - =
(2/3) Retry failed for:retry-test.test-service
, retry_seconds:10
, =
orig_cid:K05T5PX4Z3CFTV59T17FQ2DRE903
, e:`Traceback (most recent call =
last):
File =
"/opt/zato/2.0.5/zato-server/src/zato/server/pattern/invoke_retry.py", =
line 178, in invoke
result =3D self.invoking_service.invoke(target, *args, **kwargs)
File =
"/opt/zato/2.0.5/zato-server/src/zato/server/service/init.py", line =
499, in invoke
return =
self.invoke_by_impl_name(self.server.service_store.name_to_impl_name[name]=
, *args, **kwargs)
File =
"/opt/zato/2.0.5/zato-server/src/zato/server/service/init.py", line =
483, in invoke_by_impl_name
return self.update_handle(*invoke_args, **kwargs)
TypeError: update_handle() got multiple values for keyword argument =
=E2=80=98cid’
I don=E2=80=99t know where the multiple cids are being added.