@Override
	public void threadStarted() {
		logThreadStart();
		if (subscriber == null) {
			try {
				subscriber = new MqttSubscriber();
			} catch (Exception e) {
				log.warn(e.getLocalizedMessage(), e);
			}
		}
		String host = getProviderUrl();
		String list_topic = getDestination();
		String aggregate = "" + getIterationCount();
		String clientId = getClientId();
		String timeout = this.getTimeout();
		Arguments parameters = new Arguments();
		parameters.addArgument("HOST", host);
		parameters.addArgument("CLIENT_ID", clientId);
		parameters.addArgument("TOPIC", list_topic);
		// ------------------------Strategy-----------------------------------//
		if (MQTTPublisherGui.ROUND_ROBIN.equals(this.getSTRATEGY())) {
			parameters.addArgument("STRATEGY", "ROUND_ROBIN");
		} else {
			parameters.addArgument("STRATEGY", "RANDOM");
		}
		parameters.addArgument("AGGREGATE", aggregate);
		String quality = getQuality();
		parameters.addArgument("QOS", quality);
		parameters.addArgument("DURABLE",this.getCLEANSESSION());
		parameters.addArgument("TIMEOUT", timeout);

		if (this.isUseAuth()) {
			parameters.addArgument("AUTH", "TRUE");
			parameters.addArgument("USER", getUsername());
			parameters.addArgument("PASSWORD", getPassword());
		} else
			parameters.addArgument("AUTH", "FALSE");
		// -------------------------List Topic Or Not-------------------------//

		String[] topics = list_topic.split("\\s*,\\s*");
		if (topics.length <= 1) {
			parameters.addArgument("LIST_TOPIC", "FALSE");
		} else {
			parameters.addArgument("LIST_TOPIC", "TRUE");
		}
		// ------------------------Connection per topic--------------------//

		if (this.isOneConnectionPerTopic()) {
			parameters.addArgument("PER_TOPIC", "TRUE");
		} else {
			parameters.addArgument("PER_TOPIC", "FALSE");
		}
		if (this.useRandomSuffix()) {
			parameters.addArgument("RANDOM_SUFFIX", "TRUE");
			parameters.addArgument("SUFFIX_LENGTH", this.getLength());
		} else {
			parameters.addArgument("RANDOM_SUFFIX", "FALSE");
		}
		context = new JavaSamplerContext(parameters);
		subscriber.setupTest(context);
	}