I am confused. When comparing the messages services offered by Microsoft Azure, we can choose between: Event Grid Event Hubs Service Bus (Azure Cache for Redis) This link gives the following comparison: Now I’d like to write a microservice application consisting of several components. Each component should communicate local domain events to a topic (pub/sub). This could be achieved by
Tag: microservices
How to avoid duplicate code in Java when you require the same class in two separated applications?
For the sake of simplicity, let’s say that I have a class named “Dog”. Then I have two separated applications containing implementations of that class. Application “A” does something with the Dog class. Application “B” does another something with the Dog class. Both applications require the Dog class, hence it would be duplicated. Now let’s say for a moment that:
how can i differentiate between scheduled call and HTTP call of the same function in java?
i have a get function in my microservice which essentially fetchs data from a database. this function is running as a scheduler (cron job) and also as an api end point which can be triggered from the UI. i want to add some logic inside getData() which will only be executed when it is being triggered by the scheduler and
Microservices communication with optional parameters requests
I have a room service which returns detail for rooms when requesting http://localhost:8082/room/search/byRoomChar Now I want to request this @GetMapping from the booking service since this is the application gateway that users are going to interact with using the http://localhost:8081/booking/search/byRoomChar. Room entity code: Room repository code: However, this does not work because when omitting parameters when calling the getmapping from
Spring POST Method Microservice 500 exception
So, im trying to write a microservice with basic GET POST PUT DELETE commands. Its a Spring Maven Java programm with a mysql server When I try to post something it works, however if I dont include the Id it returns an exception: This is weird, because in the mysql console I can Insert a customer without the id, it
Communicate between microservices on the same machine without exposing a public API
I am relatively new to Camel and Spring, and I am making a service to predict stock prices using a neural network to practise using Camel, Spring and also DL4J. My service is divided into 5 microservices (Gateway, H2 SQL Database, Admin Console, Data Fetcher, DL4J Handler) which will each run in their own Java application. Each one has a
RedisTemplate mock is only working in the test class
Class B Now when I am writing the test for method in class B i.e. someMethod(). I have observed that the redis template mock is generating in test class but not in Class A and class B Inside ClassBTest Inside class B Why is the mock not working in class B and A ? Answer My issue is resolved now.
Multiple RestTemplate calls for each Id in a List
I need to make multiple RestTemplate calls for each of the Id in a List<Ids>. What is the best way to perform this? I have used parallelStream(). Below code snippet is a similar scenario. employeeService.fetchEmployeedetails is a kind of restCall which will fetch all the employeeDetails. Is there any other way to tune the performance? Answer .parallelStream() does not guarantee
Uni.combine().all().unis() v.s. Multi..onItem().transformToMultiAndConcatenate().collect()
In my Quarkus service, I need to fetch a list of results from external service, and I figured out there are two methods to achieve the same goal: 1st approach based on Uni.combine().all(): 2nd approach based on Multi..onItem().transformToMultiAndConcatenate().collect() In the beginning I don’t think there exists any true difference between the two approaches, as Uni are evaluated lazily and either
What is the best practice to make microservice aware about name of another microservice for interaction
I have couple of microservices written in spring boot which interact with each other to perform certain task. I need to deploy these microservices in AWS using Kubernetes. In order for microservices to interact with each other, one service need to know the name of other service. This is where I am not sure how to proceed. Since I am