Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Apache Kafka another API for JMS?

Tags:

Is not Apache Kafka another implementation of JMS?

I am using JMS+AMQ in my application, and migrating to Apache Kafka. Do I have to change all JMS codes?

like image 555
Sam Avatar asked May 26 '15 08:05

Sam


People also ask

Is Kafka based on JMS?

Kafka is a pulling-based messaging system. JMS is a pushing-based system.

What is JMS vs Kafka?

TL;DR: JMS message brokers provide messaging capabilities to produce and consume messages. Apache Kafka is a data streaming platform that combines messaging, storage, data integration, and stream processing capabilities.

Is Kafka an API?

The Kafka Streams API to implement stream processing applications and microservices. It provides higher-level functions to process event streams, including transformations, stateful operations like aggregations and joins, windowing, processing based on event-time, and more.


2 Answers

No, Kafka is different from JMS systems such as ActiveMQ. see ActiveMQ vs Apollo vs Kafka

Kafka has less features than ActiveMQ, as the stress has been put on performances. So before migrating, check that the features you use in AMQ are in Kafka.

However, there is an open suggestion for a bridge between JMS and Kafka, to allow exactly what you need. Maybe the provided links can help you https://issues.apache.org/jira/browse/KAFKA-1995

like image 95
Pixou Avatar answered Oct 23 '22 05:10

Pixou


Actually, the two are not the same. And with a little more time seeing the two co-exist - and listening to problems and happy points from those deploying each in the field - there is a little more to say about each one.

Firstly, JMS supports both point-to-point messaging (where messages are sent to single consumers; the consumers themselves maintain their message queues) and the publish-and-subscribe (pub/sub) model (where messages are written to a single topic, and consumers, independently, decide which messages to consume).

In a point-to-point messaging architecture, message producers and consumers know each other, where as in a pub/sub model they do not. Apache Kafka focuses on a pub/sub model, maintaining a separate log/topic from which consumers read from offsets. Kafka is also built for the cloud, with high-throughput a core consideration.

Many in our community and at meetups throw their hands up in frustration at MOMs (message-oriented middlewares) like JMS and switch to Kafka, for, what boils down to one reason: scalability. They argue that Kafka is better suited for scale than other MOMs because Kafka maintains a partitioned topic log. In so doing, Kafka can split up message flow to groups of consumers by partition and batch transmit the messages.

This concept also allows Kafka to have more granular control over ACLs (access control) to Kafka Consumers, although there are some issues there, which Apache Pulsar is addressing.

Finally, on Kafka, since the client/consumer decides which messages to consume (by offset in the topic), this removes some of the producer-side complexity of routing rules built into MOMs like JMS.

There's more differences than that, but this is a distillation of some of the ones that keep coming up! Hope this helps.

like image 34
John Hammink Avatar answered Oct 23 '22 05:10

John Hammink