JMS (Java Message Service) [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I was reading about JMS here and I thought "I've written a simpler consumer/producer before...". Am I being naïve about the power of JMS? I think something simpler is a better implementation of working through a Web Service to grab an XML document and pop it in a Queue. Is the approach I am taking incorrect?

If you dont need highly scalable and configurable distributed components with guaranteed delivery over multiple server crashes and automatic enrollment/commit/rollback in various transactions along with dead letter queue management, then yes a simple Queue with custom MessageProducer and MessageConsumer is probably a correct approach.
The golden rule: if the complexity of implementing a simple solution using stack X nullifies the benefits of using stack X, don't use it.

Related

Implementation approaches of event sourcing with microservices [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I'm currently wrapping my head around event sourcing and microservices, and so far, I can image the following approaches. Please correct me if I'm wrong. I'm also looking for other possible approaches.
Approach 1:
Each microservice is connected to a central Event Store. A Microservice A can publish events to the Event Store, other Microservcies subscribe to these events.
Approach 2:
Each microservice has local event store. A microservice A can directly send an event via a message broker to another microservice B.
Approach 3:
Each microservice has local event store. A microservice A can subscribe to an event store of another microservice B.
I suggest the first option. When dealing with any cross cutting concerns you might find it easier to have all your domain events in one place.
We're currently running in production an architecture based on approach 1 with roughly 20 services so far.

How to handle data synchronisation between 2 Spring apps? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm looking for the optimal way to handle the following scenario, preferably some implementation that's already been made for something like this.
There are two Systems (Springboot Webapps) that are supposed to communicate which each other through a Rest-gateway. Transfers shall be handled with Json over HTTP.
1st System is the Project part, 2nd System is the Persons part and they both implement their own persistent sql-database. Both systems depend on each others data and it cannot be expected that both systems are online at all times.
What would be the best way to achieve that both systems data is always up 2 date? Is there any plugin you could recommend to handle the synchronization process which also implements scenarios like one system shutting down while sending or the other way round?
Thanks in advance!
If you can't expect both systems to be online at all times, and you don't want any downtime when one of them is down, I think that the best way to do it is to share a common database. This has some problems of its own and you should think if it's worth, maybe you would be better having two completely independent services which rely on each other and being ready to replicate one of them if it's needed.

Unit test a single processor implementation (java) in Kafka Streams? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
The specific problem encountered is mocking context, state stores, and window objects pass into the function process.
Looks like all the examples, e.g., here and here are unit tests at the stream level (e.g., mockStreams, or using EmbeddedKafkaCluster).
If you're looking to test a single processor implementation, and need to mock context, state stores, etc, I would just use whatever testing tools you ordinarily use to mock things (Mockito, CGLIB, etc).
Beyond the scope of your question, there is also the ProcessorTopologyTestDriver. Posting in case you missed it. Kafka Streams is getting new/improved testing functionality in an upcoming version.

Sending a message between two Java components [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have a question about messaging systems.
There are two Java applications - A and B. A works constantly and checks the resource. In some cases it need to notifiy B to start. It seems that there is no need to enlarge this messaging later: there will be always two components.
What is the most elegant way to implement it? JMS? Spring Integration somehow?
Another options?
Do I understand correctly that in any case B needs to busily wait?
IMO it is better to use Apache active mq . It is open source and supports JMS 1.1 and J2EE 1.4.
As you are using two applications.You can add the message from A to Active MQ Queue and B would be continuously checking the message queue. So once B receives a message you could perform the operations that you would require.

Best way to transmit data between two applications [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
What is the best way to transmit data between two (Java) applications running on the same machine? One obvious idea would be to use standard Sockets but this doesn't feel right.
I've heard that most operating systems have a built-in system specifically for this task. How is it called and how does it work?
And is there any other good method to do something like that?
I think it depends on what you want to communicate between the applications and the size of your project. Some examples:
Sharing of state - use a database, files or similar
Messaging - use a socket. On top of a socket you have several technologies you can leverage, like HTTP/REST, but you can also create your own transport
There are also message applications you can leverage, like RabbitMQ

Categories