Skip to content

Commit

Permalink
mqtt add dyn_substitution on mqtt connect's will topic
Browse files Browse the repository at this point in the history
Dynamic substitution was not being performed on will topics on connect requests. We find useful in our usage to have this being done.
  • Loading branch information
Ricardo J. Oliveira committed Dec 7, 2017
1 parent cf6195d commit e4a829e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tsung/ts_mqtt.erl
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,11 @@ add_dynparams(true, {DynVars, _S},
_HostData) ->
NewUserName = ts_search:subst(UserName, DynVars),
NewPassword = ts_search:subst(Password, DynVars),
NewWillTopic = ts_search:subst(WillTopic, DynVars),

Param#mqtt_request{ type = connect,
clean_start = CleanStart,
keepalive = KeepAlive, will_topic = WillTopic,
keepalive = KeepAlive, will_topic = NewWillTopic,
will_qos = WillQos, will_msg = WillMsg,
will_retain = WillRetain,
username = NewUserName,
Expand Down

1 comment on commit e4a829e

@hui6075
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does dynamic topic been added for normal subscription?

Please sign in to comment.