Skip to content

Commit

Permalink
[netty#5062] Mark MqttEncoder @sharable
Browse files Browse the repository at this point in the history
Motivation:

Commit 2696778 changed MqttEncoder to be a singelton but missed to add @sharable annotation. This broke the encoder as it can not be added to multiple pipelines.

Modifications:

Add @sharable annotation

Result:

MqttEncoder can be used in multiple pipelines again.
  • Loading branch information
normanmaurer committed Apr 1, 2016
1 parent 3e5dcb5 commit 4a18bca
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import io.netty.util.CharsetUtil;
Expand All @@ -31,6 +32,7 @@
* Encodes Mqtt messages into bytes following the protocol specification v3.1
* as described here <a href="http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html">MQTTV3.1</a>
*/
@ChannelHandler.Sharable
public final class MqttEncoder extends MessageToMessageEncoder<MqttMessage> {

public static final MqttEncoder INSTANCE = new MqttEncoder();
Expand Down

0 comments on commit 4a18bca

Please sign in to comment.