Spring Cloud Zipkin with RabbitMQ not persisting in MYSQL - spring-boot

I have done all the possible matches and mix-up of dependency and still not able to record traces in zipkin ans store it in MYSQL using RabbitMQ.
Still i can see the trace and span id's in console and nothing beyond this.
Someone please take a look at the code in github from below location.
Github code: https://github.com/javayp/distributed-tracing-1

You've mixed almost everything you could have mixed. On the app side you're using both the deprecated zipkin server and the deprecated client. On the server side you're using deprecated zipkin server.
My suggestion is that you go through the documentation https://cloud.spring.io/spring-cloud-static/Edgware.SR3/single/spring-cloud.html#_spring_cloud_sleuth and read that the stream servers are deprecated and you should use the openzipkin zipkin server with rabbitmq support (https://github.com/openzipkin/zipkin/tree/master/zipkin-collector/rabbitmq).
On the consumer side use https://cloud.spring.io/spring-cloud-static/Edgware.SR3/single/spring-cloud.html#_sleuth_with_zipkin_via_rabbitmq_or_kafka . It really is as simple as that. Also don't forget to turn on the sampling percentage to 1.0

Related

Migration from Transport client to Java API client in ElasticSearch Springboot project

I am new to elasticsearch and I have a elasticsearch springboot project. We use docker to setup elasticsearch cluster and use springboot(backend),esclient to fetch data from elasticsearch. It is an old project and now I have the task of upgrading the cluster to it's latest version which is 8.x. Upon glancing upon the dependencies I saw that the project uses transport client but as per documentation the transport client is long deprecated and instead of that we were to use High level rest client client which was again deprecated in favor of JAVA Api client. So for the app to work I have to update the dependencies. I found the migration guide from transport client to high level rest client and the migration guide from high level rest client to java api client. I also gathered from the documentation that java api client and high level rest client do not have any relation and the transition to java api client can be done gradually)
Now my question is that
Suppose I upgrade from transport to java api client. Will this bring a whole lot of changes in my code as it is a really big project or is there a workaround in which I don't have to make that many changes in my code and I can work with elasticsearch version 8.
The need for the client upgrade didn't arise till now as we were still using 7.17.x and that was working fine till now but when I upgraded the cluster to version 8 and with that they are not providing transport client. My one approach is that I migrate to HLRC first and then gradually transition to JAVA api client.
Any help will be appreciated.
Regards

How to upload Spring Boot application using RabbitMQ messaging to AWS EC2?

I have a functioning application using Spring Boot, Rabbit MQ & MySQL DB locally. I'm curious, how I can upload this app to the AWS Environment and get it working seamlessly.
The only part where I'm lost is how to get RabbitMQ in the cloud? Any suggestions?
I see three options for your needs :
Use AmazonMQ managed service. This uses ActiveMQ under the hood, and supports the AMQP protocol (so you can continue to use the RabbitMQ client). Here's an article on how to do it : https://aws.amazon.com/blogs/compute/migrating-from-rabbitmq-to-amazon-mq/.
Use a third-party managed service (such as CloudAMQP). This is similar to the first option, but you can choose a RabbitMQ provider if you wish.
Install RabbitMQ on an EC2 instance and manage it yourself. This is the most flexible option, but it will require more effort on your part and it will probably cost more. I would recommend this option only if you have special requirements that are not met by using a hosted service.
In all cases, I would also recommend to use a messaging library such as Spring Messaging or Apache Camel to isolate your code from your messaging implementation. This will reduce the boilerplate code you need for messaging and allows you to focus on your application logic.

Wildfly Swarm Consul

I am trying to register a Wildfly Swarm REST service to a running Consule agent, but it's not working correctly.
I am able to register a service (I can see it in the Consul ui), but somehow the health checks are not working.
The Swarm Server keeps frequently telling me, that "sending the check" failed due to "HTTP 405 Method not allowed". I can see simular logs in the Consule console, that GET method is not allowed.
I am at a dead end: My application is not working, nor does the Wildfly Swarm example (same exception). I also configured a CORS filter on both sides just to be sure, but thats not working either.
I am using Wildfly Swarm 2017.10.1 and Consul 1.0.0.
I hope you guys can help.
Best regards
I figured it out myself. Obviously, it wasn't that hard ^^
I checked the version of the Consul Client API which is used for my Wildfly Swarm version: It's 0.9.16. I've downloaded all Consul versions and checked which one are compatible. I can verify that all versions up to 0.9.3 are working.
Consul 1.0.0 has some very critical breaking changes and I really don't understand why they were not implemented in a HTTP API v2, but thats not the point here.
I highly recommend to upgrade the Consul Client API used by the topology-consul fraction to a newer version like 0.16.5 or 0.17.0.
At least, please add a note in the README for the ribbon-consul example what Consul versions can be used.

Jax-rs and amqp zipkin integration

I've been roaming the depths of the internet but I find myself unsatisfied by the examples I've found so far. Can someone point me or, show me, a good starting point to integrate zipkin tracing with jaxrs clients and amqp clients?
My scenario is quite simple and I'd expect this task to be trivial tbh. We have a micro services based architecture and it's time we start tracing our requests and have global perspective of our inter service dependencies and what the requests actually look like (we do have metrics but I want more!) . The communication is done via jax-rs auto generated clients and we use rabbit template for messaging.
I've seen brave integrations with jaxrs but they are a bit simplistic. My zipkin server is a spring boot mini app using stream-rabbit, so zipkin data is sent using rabbitmq.
Thanks in advance.
After some discussion with Marcin Grzejszczak and Adrien Cole (zipkin and sleuth creators/active developers) I ended up creating a Jersey filter that acts as bridge between sleuth and brave. Regarding AMQP integration, added a new #StreamListener with a conditional for zipkin format spans (using headers). Sending messages to the sleuth exchange with zipkin format will then be valid and consumed by the listener. For javascript (zipkin-js), I ended up creating a new AMQP Logger that sends zipkin spans to a determined exchange. If someone ends up reading this and needs more detail, you're welcome to reach out to me.

Setup STOMP client in plain java spring

I am looking for a STOMP example to write server and client both in java spring. Please someone provide me a good simple example.
Currently the Spring Framework does not come with a native Java STOMP client yet, only the server side is provided so far. It is well documented here:
http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/websocket.html#websocket-stomp
It seems like there will be a native Java STOMP client in the upcoming Spring Framework 4.2 release (currently due to date is July 1st 2015). It is available in the snapshot already. Just take a look at https://jira.spring.io/browse/SPR-11588
There is a link to the commit adding the STOMP client functionality done by Rossen Stoyanchev.
If you want some examples you can take a look at the tests provided, e.g. WebSocketStompClientIntegrationTests.java.
I hope this helps to get started.

Resources