{
  "synLogic": "int $ret \u003d $api($1, $2, $3);",
  "help": "The ns_kafka_set_putMsg_timeout function is used to set the timeout for producing a message to a Kafka topic. This function is part of a larger library or application that interacts with Apache Kafka, a distributed streaming platform. This function should be called before sending a message to a Kafka topic. It sets the maximum time the producer will wait for a message to be produced before timing out. If the producer cannot produce the message within the specified time, the function will return an error message.",
  "notes": "",
  "returns": "In C it returns 0 if the header was successfully added, or -1 if an error occurred. In Java this api returns an boolean value",
  "arguments": "\u003ctable class\u003d\"newGuiTable\" style\u003d\"width:100%\"\u003e \u003ctbody\u003e\u003ctr\u003e \u003cth\u003e Argument \u003c/th\u003e \u003cth\u003e Description \u003c/th\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e JPID \u003c/td\u003e \u003ctd\u003e It is the pool id returned from ns_kafka_init_producer () or ns_kafka_init_consumer () api. \u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e Timeout \u003c/td\u003e \u003ctd\u003e This is the amount of time, in seconds, that the function will wait for a message to be produced before timing out. \u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e Error Message \u003c/td\u003e \u003ctd\u003e This is a character pointer to a buffer where error messages can be stored if the function encounters an error. \u003c/td\u003e \u003c/tr\u003e \u003c/tbody\u003e\u003c/table\u003e",
  "parameterization": "",
  "component": [
    {
      "id": "$1",
      "type": "TextField",
      "label": "JMS Pool Connection Id",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "First character must be Alpha.\r\nOther characters are Alpha, Numeric or Underscore",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "If JMS Connection id is a program variable",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,63}$",
        "required": false,
        "min": 0,
        "max": 0,
        "method": "isValidVar(arg)"
      },
      "quotes": false
    },
    {
      "id": "$2",
      "type": "TextField",
      "label": "Timeout",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Timeout should be numeric",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "pattern": "^[0-9]+(.[0-9]*)?$",
        "required": true,
        "min": 0,
        "max": 0
      },
      "quotes": false
    },
    {
      "id": "$3",
      "type": "TextField",
      "label": "Error Message Buffer Pointer",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter error message",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0
      },
      "quotes": false
    },
    {
      "id": "$ret",
      "type": "TextField",
      "label": "Return Variable",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "First character must be Alpha.\r\nOther characters are Alpha, Numeric or Underscore.",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,63}$",
        "required": false,
        "min": 0,
        "max": 0,
        "method": "isValidVar(arg)"
      },
      "quotes": true
    }
  ],
  "name": "ns_kafka_set_putMsg_timeout",
  "syntax": "int ns_kafka_set_putMsg_timeout(int jpid, double timeout, char *error_msg);",
  "javaSyntax": "boolean ns_kafka_set_putMsg_timeout(JMSKey key, double timeout);",
  "cEx": "flow()\n{\n  int jpid \u003d 123;\n  double timeout \u003d 10.0;\n  char error_msg[256];\n\n  if(jcid \u003d ns_kafka_set_putMsg_timeout(jpid, timeout, error_msg))\n  {\n    fprintf(stderr, \"Error in initializing. Error code \u003d %d, Error Msg \u003d %s\", jcid, error_msg);\n    return;\n  }\n}",
  "javaEx": "public class flow implements NsFlow\n{\n  public int execute(NSApi nsApi) throws Exception \n  {\n        NSApi.JMSKey key \u003d null;\n        double timeout \u003d 5000;\n\n        // It sets the maximum time the producer will wait for a message to be produced before timing out.\n        // This function should be called before sending a message to a Kafka topic.\n        if(!nsApi.ns_kafka_set_putMsg_timeout(key, timeout))\n        {\n         System.out.println(\"Error in setting PutMessage timeout. Error code \u003d \" + key.getErrCode() + \", Error Msg \u003d \" + key.getErrMsg());\n         return 0;\n        }\n  }\n}",
  "insertStrC": "ns_kafka_set_putMsg_timeout(int jpid, double timeout, char *error_msg);",
  "insertStrJava": "ns_kafka_set_putMsg_timeout(JMSKey key, double timeout);",
  "description": "The ns_kafka_set_putMsg_timeout function is used to set the timeout for producing a message to a Kafka topic. This function is part of a larger library or application that interacts with Apache Kafka, a distributed streaming platform. This function should be called before sending a message to a Kafka topic. It sets the maximum time the producer will wait for a message to be produced before timing out. If the producer cannot produce the message within the specified time, the function will return an error message."
}