How to subscribe to multiple topics at the same time in callback when using pubsubClient library?

I wrote the code to subscribe to two topics at the same time, but it seems the topic 'getStartus' is not working. Can you help me? This is my code.

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Tin nhan[");
  Serial.print(topic);
  Serial.print("] ");
  for (int i = 0; i < length; i++) {
    Serial.print((char)payload[i]);
  }
  Serial.println();


  if(strcmp(topic, "S") == 0){  
    if ((char)payload[0] == '0') {
      if(isChandeOn==true){
        client.publish(pubChan, "Turn of chandelier by MQTT");
        isChandeOn = false;
      }else{
        client.publish(pubChan, "Turn on chandelier by MQTT");
        isChandeOn = true;
      }
    } else if ((char)payload[0] =='1'){
        if(isChandeOn==true){
          client.publish(pubAir, "Turn of Air conditional by MQTT");
          isAirOn = false;
        }else{
          client.publish(pubAir, "Turn on Air conditional by MQTT");
          isAirOn = true;
      }
    } else if((char)payload[0] == '2')
    {
      if(isFanOn==true){
        client.publish(pubFan, "Turn of Fan by MQTT");
        isFanOn = false;
      }else{
        client.publish(pubFan, "Turn on Fan by MQTT");
        isFanOn = true;
      }
    }
    else if((char)payload[0] == '3')
    {
      if(isTvOn==true){
        client.publish(pubTV, "Turn of TV by MQTT");
        isTvOn = false;
      }else{
        client.publish(pubTV, "Turn on TV by MQTT");
        isTvOn = true;
      }    
    }
  }
  else if(strcmp(topic, "getStatus") == 0)
  {
    if ((char)payload[0] == '0') {
    if(isAirOn == false){
      client.publish(pubAir, "0");
    } else {client.publish(pubAir, "1");}

    if(isChandeOn == false){
      client.publish(pubChan, "0");
    } else {client.publish(pubChan, "1");}

    if(isFanOn == false){
      client.publish(pubFan, "0");
    } else {client.publish(pubFan, "1");}

    if(isTvOn == false){
      client.publish(pubTV, "0");
    } else {client.publish(pubTV, "1");}
  }
  }
}

Do you mean "getStatus" ?

What do you mean by "not working" ? Do you mean that you never receive anything from it or that it is not matched in

    else if (strcmp(topic, "getStatus") == 0)

Yes, topic:"getStatus" did not receive any messages, even though I tested that topic on the terminal.

I moved your topic to an appropriate forum category @doxuanhieu.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

That would seem not to have anything to do with the code snippet that you posted as it does not publish to that topic, so what does ?