27

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?

Franta
  • 986
  • 10
  • 17
Sam
  • 6,770
  • 7
  • 50
  • 91

3 Answers3

27

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

Community
  • 1
  • 1
Pixou
  • 1,719
  • 13
  • 23
15

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.

John Hammink
  • 209
  • 3
  • 3
3

No, Kafka uses its own non-standard protocol and clients.

However, there's a 3rd-party JMS Client for Kafka from Confluent.

Kunda
  • 463
  • 3
  • 5
  • see also this thread http://stackoverflow.com/questions/34990844/connection-between-apache-kafka-and-jms – Casey May 17 '17 at 13:18
  • 1
    Not sure it's correct to call Kafka proprietary. It's completely open source and under the stewardship of the Apache Software Foundation ( https://www.apache.org ) which publishes the source code for clients, brokers, and the Kafka protocol. – Hans Jespersen May 18 '17 at 04:37
  • 3
    The JMS spec is an API spec defined by the Java Community Process. AMQP 1.0 is a protocol spec defined by OASIS. Neither JMS, nor AMQP are software like ActiveMQ and Kafka. There are both proprietary and open source software implementations of both JMS and AMQP. Apache ActiveMQ and Apache Kafka are projects of the Apache Software Foundation and are licensed as Free Open Source Software (FOSS) "which is in contrast to proprietary software, where the software is under restrictive copyright and the source code is usually hidden from the users". – Hans Jespersen May 19 '17 at 07:10
  • I've probably misused the term "proprietary" since I'm not a native English speaker - edited my answer to reflect what I meant more precisely. – Kunda May 19 '17 at 20:08