Blocking vs non-blocking call mediator in API Manager - wso2-api-manager

I'm wondering if some can explain why the call mediator only works in WSO2 API Manager (2.x) when you set blocking=true in the properties of the call mediator.
I have tested the same sequence in API manager and ESB and a sequence with the following snippet works fine in ESB, but not in API manager unless I set blocking=true on the call mediator
<call description="Get Auth token">
<endpoint>
<http method="get" trace="disable" uri-template="https://some.service.com/auth/api/token"/>
</endpoint>
When I use this in API manager, I do get a response but the sequence does not continue.
Is there a way to use the non-blocking call mediator in API manager?
Thanks,
Danny

I was wondering the same today, and blocking=true is to do synchronous messaging, whereas blocking=false which is to do asynchronous messaging.
You need to send a 202 response before the sequence goes on.

Related

How to create command by consuming message from kafka topic rather than through Rest API

I'm using Axon version (3.3) which seamlessly supports Kafka with annotation in the SpringBoot Main class using
#SpringBootApplication(exclude = KafkaAutoConfiguration.class)
In our use case, the command side microservice need to pick message from kafka topic rather than we expose it as Rest api. It will store the event in event store and then move it to another kafka topic for query side microservice to consume.
Since KafkaAutoCOnfiguration is disabled, I cannot use spring-kafka configuration to write a consumer. How can I consume a normal message in Axon?
I tried writing a normal Kafka spring Consumer but since Kafka Auto COnfiguration is disabled, initial trigger for the command is not picked up from the Kafka topic
I think I can help you out with this.
The Axon Kafka Extension is solely meant for Events.
Thus, it is not intended to dispatch Commands or Queries from one node to another.
This is very intentionally, as Event messages have different routing needs apposed to Command and Query messages.
Axon views Kafka a fine fit as an Event Bus and as such this is supported through the framework.
It is however not ideal for Command messages (should be routed to a single handler, always) or Query messages (can be routed to a single handler, several handlers or have a subscription model).
Thus, I you'd want to "abuse" Kafka for different types of messages in conjunction with Axon, you will have to write your own component/service for it.
I would however stick to the messaging paradigm and separate these concerns.
For far increasing simplicity when routing messages between Axon applications, I'd highly recommend trying out Axon Server.
Additionally, here you can hear/see Allard Buijze point out the different routing needs per message type (thus the reason why Axon's Kafka Extension only deals with Event messages).

Spring Cloud Contract and Spring-WS Endpoints

Can Spring Cloud Contract be used to test Spring Boot services that are running Spring-WS Endpoints? I would like the ability to define SOAP requests/responses using the Groovy DSL, but I haven't been able to get these services to work with Spring Cloud Contract. I keep getting a failure (expected 200 but received a 404) when I try to run these tests. Interestingly, I added #RestController and #RequestMapping annotations to my Endpoint class (knowing it wouldn't work) just to test whether or not the fact that these services are Spring-WS endpoints and not Spring REST controllers may be the problem (i.e., does Spring Cloud Contract only "see" REST endpoints?). And...I moved on to a different set of errors. So, I am assuming at this point that I can not use Spring Cloud Contract to test my SOAP services, but I would like to know for sure (i.e., is there some way to do this that I haven't discovered yet?).
Our core services are implemented as REST services, but we still have to support our SOAP clients until they can migrate to REST, so they wrap our REST services. I need the ability to test both. I have successfully created tests for our REST services.
Try using the explicit mode to make rest assured send real request. In the base class you'll have to setup the whole application so that it bindd to a real port. Then in the before section of your test you need to tell rest assured that I'd should call the following port. And that's it :P

CA AutoSys scripting supports invoking anonymous & secured REST service?

Need to write a AutoSys script to invoke a REST service e.g. http://example.com/api/job/test-job and then setup a AutoSys Job.
AutoSys script supports REST service? If yes, will it support only anonymous REST service or it can support secured service as well?
Also, can it record HTTP response code? if yes, can it record HTTP response 200 OK as success and rest as failure when job runs?
There is no such thing as an "Autosys script". Autosys is just a scheduling software, such as crontab is. You cannot create a script with it.
If you can create a script (using bash, ksh, python, perl,...) or a binary file that does the API call you need, then Autosys will be here to start it and give you back the log (if any) and the return code.
See this link - https://support.ca.com/cadocs/0/CA%20Workload%20Automation%20System%20Agent%20r11%203-ENU/Bookshelf_Files/HTML/WebServicesCLIUser_11_3_1/index.htm
CA seems to support an Automation Agent using CLI through which you may invoke HTTP/HTTPS Web Services although there is no information provided on the response codes.
Also if FileWatcher can trigger HTTP requests, then some sort of REST interface to the pertinent web app functionality might work. There does not seem to be any way for AutoSys to directly invoke and record response for a REST service though.
As an alternative you can always interface with the web service using another platform (such as Java) and calling the same via AutoSys.

How to programmatically terminate a workflow instance running as a workflow service

I am using windows workflow service and would like to programmatically terminate a specific workflow instance via a web service request without building this into the workflow itself.
By building it into the workflow itself, I mean having a specific Receive activity which will be responsible for terminating the activity.
So I am imagining something like:
http://myhost/myworkflowservice/myworkflow.xamlx/terminate
Does this type of functionality exist?
Thanks,
Eric
Just add a Workflow Control Endpoint which allows one to call remote operations on workflow service. Add it through web.config:
<endpoint address="<endpoint_address>" binding="basicHttpBinding" kind="workflowControlEndpoint" />
Then you can use WorkflowControlClient to call control messages (Run, Cancel, Suspend, etc.) to a WorkflowControlEndpoint.

Async publish on a JMS topic using webmethods

How do I do an async publish for a JMS topic hosted on a webmethods broker? I am looking for something similar to what Active MQ provides, but using webmethods instead:
http://activemq.apache.org/async-sends.html
I'm not sure what you mean by "a JMS topic hosted on a webmethods broker", but you can publish any webMethods document anywhere in your flow with the pub.publish:publish service. You can subscribe to any published document by adding a trigger on that document type, along with the flow service that should be called when the document is received.
A bit different than ActiveMQ, but pretty straightforward.
Try this:
It has a sample C# project:
http://techcommunity.softwareag.com/ecosystem/communities/codesamples/webmethods/messaging/SAMPLE-20120523120201999.html

Resources