{
  "synLogic": "int $ret \u003d $api($1, $2, $3, $4, $5, $6, $7, $8, $9);",
  "help": "This function initializes an IBM MQ consumer with the given parameters and creates a connection pool of size pool_size. It returns the JMS Pool ID which needs to be passed to get a connection from the pool. In case of an error, it returns an error code with an error message set in the error_msg parameter",
  "notes": "",
  "returns": "\nFunction returns a value less than zero, an error has occurred. The error code and error message are then printed to the standard error stream using fprintf(). \nIf there is no error, the program will proceed to consume messages from the IBM MQ queue using other functions not shown in the provided code snippet.",
  "arguments": "\u003ctable class\u003d\"newGuiTable\" style\u003d\"width:100%\" \u003e \u003ctr\u003e         \u003cth\u003eArgument\u003c/th\u003e     \u003cth\u003eDescription\u003c/th\u003e     \u003c/tr\u003e              \u003ctr\u003e    \u003ctd\u003eHost Name\u003c/td\u003e     \u003ctd\u003e     The hostname or IP address of the IBM MQ server.        \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e       \u003ctd\u003ePort\u003c/td\u003e     \u003ctd\u003e The port number on which the IBM MQ server is listening.        \u003c/td\u003e     \u003c/tr\u003e     \u003ctr\u003e    \u003ctd\u003eQueue Manager\u003c/td\u003e     \u003ctd\u003e The name of the IBM MQ queue manager. \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003eChannel\u003c/td\u003e     \u003ctd\u003e            The name of the channel used to connect to the IBM MQ server.         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003eQueue\u003c/td\u003e     \u003ctd\u003e            The name of the IBM MQ queue to consume messages from.         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003eUser Name\u003c/td\u003e     \u003ctd\u003e           The user ID to connect to the IBM MQ server.         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003ePassword\u003c/td\u003e     \u003ctd\u003e            The password to connect to the IBM MQ server. It should be base64 encoded.         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003ePool Size\u003c/td\u003e     \u003ctd\u003e      The maximum size of the connection pool.         \u003c/td\u003e     \u003c/tr\u003e  \u003ctr\u003e    \u003ctd\u003eError Message\u003c/td\u003e     \u003ctd\u003e  A character array to store the error message in case of an error. \u003c/td\u003e     \u003c/tr\u003e  \u003c/table\u003e",
  "parameterization": "",
  "name": "ns_ibmmq_init_consumer",
  "syntax": "int ns_ibmmq_init_consumer(char *ibmmq_hostname, int ibmmq_port,  char *queue_manager,  char *channel, char *ibmmq_queue,char *ibmmq_userId, char *ibmmq_password, int max_pool_size, char *error_msg)",
  "javaSyntax": "int ns_ibmmq_init_consumer(char *ibmmq_hostname, int ibmmq_port,  char *queue_manager,  char *channel, char *ibmmq_queue,char *ibmmq_userId, char *ibmmq_password, int max_pool_size, char *error_msg)",
  "cEx": "flow()\n{\n  int jpid;	// JMS Pool Id\n  int jcid;	// JMS Connection Id\n  char error_msg[1024 + 1];	// Error string. Must be 1024 size\n  int ret;	// Error code\n  int msg_len = 1024;\n  char msg[1024 + 1];\n\n  if((jpid = ns_ibmmq_init_consumer(\"127.0.0.1\", 1414, \"queue_manager\", \"channel\", \"queue\", \"user_id\", \"mWWDbw3Cjb0lke7UZuaS0A==\", 1, error_msg)) < 0)\n  {\n    fprintf(stderr, \"Error in initializing IBMMQ consumer. Error code = %d, Error Msg = %s\", jpid, error_msg);\n    return;\n  }\n}",
  "javaEx": "flow()\n{\n  int jpid;	// JMS Pool Id\n  int jcid;	// JMS Connection Id\n  char error_msg[1024 + 1];	// Error string. Must be 1024 size\n  int ret;	// Error code\n  int msg_len = 1024;\n  char msg[1024 + 1];\n\n  if((jpid = ns_ibmmq_init_consumer(\"127.0.0.1\", 1414, \"queue_manager\", \"channel\", \"queue\", \"user_id\", \"mWWDbw3Cjb0lke7UZuaS0A==\", 1, error_msg)) < 0)\n  {\n    fprintf(stderr, \"Error in initializing IBMMQ consumer. Error code = %d, Error Msg = %s\", jpid, error_msg);\n    return;\n  }\n}",
  "insertStrC": "ns_ibmmq_init_consumer(char *ibmmq_hostname, int ibmmq_port,  char *queue_manager,  char *channel, char *ibmmq_queue,char *ibmmq_userId, char *ibmmq_password, int max_pool_size, char *error_msg);",
  "insertStrJava": "int ns_ibmmq_init_consumer(char *ibmmq_hostname, int ibmmq_port,  char *queue_manager,  char *channel, char *ibmmq_queue,char *ibmmq_userId, char *ibmmq_password, int max_pool_size, char *error_msg)",
  "description": "This function initializes an IBM MQ consumer with the given parameters and creates a connection pool of size pool_size. It returns the JMS Pool ID which needs to be passed to get a connection from the pool. In case of an error, it returns an error code with an error message set in the error_msg parameter.",
  "component": [
    {
      "id": "$1",
      "type": "TextField",
      "label": "Host Name",
      "labelVarCheckbox": "If host name is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter host name",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
    {
      "id": "$2",
      "type": "TextField",
      "label": "Port",
      "labelVarCheckbox": "",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter port",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Number",
        "required": true,
		"max": 2147483647,
		"min": 0
		}
    },
	{
      "id": "$3",
      "type": "TextField",
      "label": "Queue Manager",
      "labelVarCheckbox": "If queue manager is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter queue manager",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$4",
      "type": "TextField",
      "label": "Channel",
      "labelVarCheckbox": "If channel is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter channel",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$5",
      "type": "TextField",
      "label": "Queue",
      "labelVarCheckbox": "If queue is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter queue",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$6",
      "type": "TextField",
      "label": "Username",
      "labelVarCheckbox": "If username is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter username",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$7",
      "type": "TextField",
      "label": "Password",
	  "labelVarCheckbox": "If username is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter Passowrd",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
	{
      "id": "$8",
      "type": "TextField",
      "label": "Pool Size",
      "labelVarCheckbox": "",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter pool size",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Number",
        "required": true,
		"max": 2147483647,
		"min": 0
		}
    },
	{
      "id": "$9",
      "type": "TEXT_VAR",
      "label": "Error Message",
      "labelVarCheckbox": "If error message is a program variable.",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter error message",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "validate": {
        "inputType": "Text",
        "required": true
		}
    },
    {
      "id": "$ret",
      "type": "TextField",
      "label": "Return Variable",
      "labelVarCheckbox": "",
      "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": "",
      "validate": {
        "inputType": "Text",
	"pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,63}$",
        "required": false,
        "method": "isValidVar(arg)"
      }
    }
  ]
}
