Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT Streaming: incompatibility with Akka 2.6.0 or Akka 2.6.1 #2097

Closed
jcroig opened this issue Jan 16, 2020 · 8 comments
Closed

MQTT Streaming: incompatibility with Akka 2.6.0 or Akka 2.6.1 #2097

jcroig opened this issue Jan 16, 2020 · 8 comments
Assignees
Milestone

Comments

@jcroig
Copy link
Contributor

jcroig commented Jan 16, 2020

Versions used

Akka version:

2.6.0

Expected Behavior

We should be able to start an MQTT Server using alpakka mqtt streaming when running last Alpakka artifact in a project along with Akka 2.6.1.

Actual Behavior

Get this runtime exception:

java.lang.NoClassDefFoundError: akka/actor/typed/scaladsl/adapter/package$UntypedActorRefOps$ at akka.stream.alpakka.mqtt.streaming.scaladsl.ActorMqttServerSession.<init>(MqttSession.scala:455)

The problem is that implicit class UntypedActorRefOps has been renamed to ClassicActorRefOps from Akka 2.5.27 to Akka 2.6.x so when the artifact is built compiling with Akka 2.5.27 it fails to run with Akka 2.6.x

Relevant logs

Reproducible Test Case

Build Alpakka with Akka 2.5.27 and then use the artifact in a project with Akka 2.6.1. Try to start a MQTT broker with akka.stream.alpakka.mqtt.streaming.scaladsl.ActorMqttServerSession.

@ennru ennru added this to the 2.0.0 milestone Jan 27, 2020
@ennru ennru changed the title Runtime error when running MQTT server with Akka 2.6.0 or Akka 2.6.1 MQTT Streaming: incompatibility with Akka 2.6.0 or Akka 2.6.1 Jan 27, 2020
@ennru
Copy link
Member

ennru commented Jan 27, 2020

The implicit conversion class for ActorRef has been renamed between Akka 2.5 and 2.6 (there was not binary-compatibility guarantee for Akka Typed).

@huntc
Copy link
Contributor

huntc commented Jan 27, 2020

There shouldn’t be an expectation of binary compatibility between 2.5 and 2.6, right? https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html

@ennru
Copy link
Member

ennru commented Jan 27, 2020

Exactly. Some Akka Typed API changes between 2.5 and 2.6. What is nasty for Alpakka with this is that it is source-compatible, but not binary-compatible. So we can't distribute just one jar to support both Akka versions.

@huntc
Copy link
Contributor

huntc commented Jan 27, 2020

So we can't distribute just one jar to support both Akka versions.

I think you’re going to have to have two jars.

@ennru
Copy link
Member

ennru commented Jan 31, 2020

We will tweak the build to just build and publish an Akka 2.6 compatible jar for Alpakka MQTT streaming.

@raboof
Copy link
Member

raboof commented Jan 31, 2020

There shouldn’t be an expectation of binary compatibility between 2.5 and 2.6, right? https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html

2.6 is binary compatible with 2.5, except for API's that were already deprecated in 2.5 or marked may-change or experimental. The typed API's were still marked may-change in 2.5, so that's why they could still change there.

@huntc
Copy link
Contributor

huntc commented Jan 31, 2020

2.6 is binary compatible with 2.5, except for API's that were already deprecated in 2.5 or marked may-change or experimental.

While that may be the case now, it is permissible that 2.6 APIs can become binary incompatible with 2.5 in the future though.

@ennru
Copy link
Member

ennru commented Feb 13, 2020

#2118 changed MQTT streaming to be Akka 2.6 compatible (and can't be used with Akka 2.5 anymore).

@ennru ennru closed this as completed Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants