tsung
tsung copied to clipboard
MQTT Subscriber not working with Tsung
Hi,
I am trying to do the load testing of my MQTT Broker using Tsung as client. Although i am able to connect the client as publisher to Rabbit MQ but unable to connect the client as subscriber. Note: I am using SSL (TLS) for authentication purpose I am getting following error Can anyone please suggest the mqtt subscriber configuration to resolve
** Reason for termination = error:{badrecord,session}
** Callback mode = state_functions
** Stacktrace =
** [{ssl_session,'-select_session/3-fun-0-',3,
[{file,"ssl_session.erl"},{line,105}]},
{lists,dropwhile,2,[{file,"lists.erl"},{line,1396}]},
{ssl_session,select_session,3,[{file,"ssl_session.erl"},{line,109}]},
{ssl_session,client_id,4,[{file,"ssl_session.erl"},{line,57}]},
{tls_handshake,client_hello,8,[{file,"tls_handshake.erl"},{line,69}]},
{tls_connection,init,3,[{file,"tls_connection.erl"},{line,219}]},
{gen_statem,call_state_function,5,[{file,"gen_statem.erl"},{line,1223}]},
{gen_statem,loop_event,6,[{file,"gen_statem.erl"},{line,995}]}]
Here is the snippet of mqtt.xml configuration for subscriber (which i downloaded from tsung open source)
<clients>
<client host="ABC" maxusers="5"></client>
</clients>
<servers>
<server host="10.1.1.20" port="8883" type="ssl" />
</servers>
<load>
<user session="mqtt_subscriber" start_time="1" unit="second"></user>
<arrivalphase phase="1" duration="40" unit="second">
<users maxnumber="35" arrivalrate="1" unit="second"></users>
</arrivalphase>
</load>
<sessions>
<session name="mqtt_subscriber" probability="100" type="ts_mqtt">
<set_option name="certificate">
<certificate cacertfile="/Users/abc/server.pem"
keyfile="/Users/abc/client-key.pem" keypass="" certfile="/Users/abc/client-crt.pem"/>
</set_option>
<request>
<mqtt type="connect" clean_start="true" keepalive="10"></mqtt>
</request>
<request subst="true">
<mqtt type="subscribe" topic="test_topic" qos="1"></mqtt>
</request>
<request>
<!-- wait for 60s -->
<mqtt type="waitForMessages" timeout="60"></mqtt>
</request>
<request subst="true">
<mqtt type="unsubscribe" topic="test_topic"></mqtt>
</request>
<request>
<mqtt type="disconnect"></mqtt>
</request>
</session>
</sessions>
Hi Which version of tsung and erlang are you using ?
Hi,
Tsung version : Tsung version 1.6.1_git Erlang: V9.0
I guess you wanted to say you are using Erlang R19? Did you gave the current tsung 1.7.0 a try?
Is there any update on this please? I am facing the same issue while testing it in my local.