Integrate AWS XRay HttpClientBuilder with Spring Webclient - spring-webflux

I am using Spring Webclient for my microservices for external calls. I am trying to Integrate AWS XRay in our microservices. But to get the traces of Outgoing HTTP calls in xray, I have to use XRay HttpClientBuilder. Is there any way i can integrate XRAY HttpClientBuilder with webclient?

XRay java SDK currently only supports downstream HTTP Requests with Apache clients. Alternatively, you can checkout the AWS Distro for OpenTelemetry Java agent (docs), which is a ready-to-use OpenTelemetry auto-instrumentation agent that's compatible with the X-Ray backend and supports Spring WebClient.

Related

Quarkus / Keycloak - How to mock a Keycloak server in tests

I'm using Quarkus 1.7 and KeyCloak 10.0.0
I cannot find resources of how to mock Keycloak server.
Because test cannot start if Quarkus do not find a Keycloak server.
It will be helpful to have more informations
Best
There is a section about integration testing using Wiremock in the quarkus OAuth2 security guide.

Can we use postman to test Corda api

Im a beginner in developing CorDapps, so far I have successfully written flows and such, I am currently learning how to code APIs for Corda, and I'm not sure if I could test Corda APIs in postman like regular APIs, any info would be greatly appreciated.
The Corda Webserver that you're referring to is simply a Jetty server that connects to the Corda node using the CordaRPCClient library, then provides an HTTP API that allows the webserver to map HTTP requests from users to RPC operations on the node. You can test this API in the same way as a regular server (e.g. by using Postman).
Please note that the Corda Webserver is deprecated as of Corda 3 and you are expected to create your own Java webserver mapping HTTP requests to RPC operations instead. See the Spring Webserver sample here for an example.

API gateway vs Mule server

enter image description here
Do they each have a specific purpose? Is one better suited than the other for a particular task?
They are two different distributions and serve different purposes.
API Gateway- It has specific features to communicate to Anypoint Platform to manage APIs, apply runtime policies, send analytics, track APIs.
Task- For deploying your proxy API Application
Mule Server- Mule server is the runtime you use for your integrations.
Task- For deploying your actual implementation API Application
Since Mule runtime version v3.8.0, both are one and the same. This means that since that version, the runtime is shipped with API Gateway capabilities, and there is no more API Gateway specific distributions released. To enable API Gateway capabilities, if you have the correct entitlement, you only need to specify your organization credentials or environment credentials (this last, it is only applicable to Mule 4 or newer).
API Gateway capabilities are the only ones who "know" how to apply/un-apply Anypoint Policies and generate Analytics info, among other things.
For runtimes released before v3.8.0, the only way to leverage those capabilities was to use API Gateway distribution. For example, API Gateway v2.x is based on Mule runtime v3.7.x.

How to apply different policies to service and proxy service?

I have a mule service, named IS, deployed on mule runtime and proxied on API gateway. I'd like to set up different policies to the IS and its proxy service. How can I do it?
My environment:
Mule runtime: 3.7.4
Mule API gateway: 2.1.1
The following are two valid and equally correct solutions that you can choose from, taking into account that your implementation API is a Mule app:
Create an API on API Platform
Solution A:
Configure the autogenerated proxy to use your implementation API URL
Deploy the proxy to a correctly configured API Gateway/Mule runtime
>= v3.8.0
Apply one or more policies to the tracked proxy
Solution B:
Add autodiscovery to your implementation API, using the same API
name and API version name than your already created API on API
Platform
Deploy the impl app to a correctly configured API
Gateway/Mule runtime >= v3.8.0
Apply one or more policies to the tracked implementation app
With solution A, you have to make sure that your implementation app is only accessible by the proxy app (eg with a firewall).
If your implementation API would not be a Mule app, then Solution B would not be possible.
We can create endpoint with a proxy or select Basic endpoint if you create your API outside API Manager, for example, you created the API using Mule ESB. You don’t need a proxy in this case. So policies will be applied to API. For more details go through the link.
https://docs.mulesoft.com/api-manager/setting-up-an-api-proxy
If you're using Mule runtime v3.8.x, and if the service is an HTTP/S listener, you can actually make it auto-discovered in the API Manager and have policies applied directly on it, even if the mule config is not generated using APIkit.
https://docs.mulesoft.com/api-manager/api-auto-discovery
Choose the flow that you want the API Manager to manage and apply policies.
Do note that you will need to have to right entitlement (API Gateway) in the Mule Runtime license and that it has the right Anypoint Platform Client ID/Secret pairs configured in the wrapper.conf. The IDs should be automatically configured if you've added the Mule Runtime server in the Anypoint Runtime Manager.
Here is my solution to apply policy to proxy service:
Create a new API using proxy service's url
Apply policy to API created in step1
Can anyone confirm this is the correct way?

Mule:How to connect Mule ESB with Hybris?

I have a requirement to connect Mule ESB with Hybris. I didnt find Hybris connector provided by Mule( Also didnt find sample examples as well). This is the 1st time going to try Mule with Hybris..Please let me know the steps or efficient procedural way to connect Hybris.
Is the hybris URL enough to connect?. Please suggest me with your thoughts to implement. Thanks in advance.
Hybris has many ways to integrate with their platform. If you have a login you can access their docs which details examples of integration with the platform including JMS and the Platform Web Services.
There is no connector supplied by Mule, but you can access their Platform Web Services which are implemented with a HTTP Restful API using the Mule http transport or by building your own connector using the Mule DevKit.
The hybris wiki has pages dedicated to most of the endpoints and the request/response formats. You can view this here if you have a login: https://wiki.hybris.com/display/release5/WebService+API+-+Reference
Also, in your hybris installation there are a bunch of examples in /bin/ext-platform-optional/platformwebservices/src...
and /bin/ext-platform-optional/platformwebservices/testsrc which show the actual web service implementations and their test cases using Jersey client.