Qpid Broker-J - Configuring nodeAutoCreationPolicies for an BDB_HA cluster from json

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Qpid Broker-J - Configuring nodeAutoCreationPolicies for an BDB_HA cluster from json

Tom Jordahl
Added qualifying subject (sorry I missed it the first time).

Anyone configure Broker-J with a json file on disk that might have some insight?

--
Tom
 

On 4/26/19, 4:43 PM, "Tom Jordahl" <[hidden email]> wrote:

    Hello,
   
    I am configuring Qpid in a HA configuration (BDB_HA) via a Chef recipe, so I am using the {qpid.work_dir}/config.json file to create the initial configuration when Qpid starts up.
   
    I would like the following Node Creation Policy to be configured in my Virtual Host, but when I add it to the config, it seems to be ignored.  I tried putting the entry in the broker configuration (i.e. right below the "name" entry in the top level config) and after using the REST API to get the virtual host config on a hand configured server, I moved it in to the virtualhostnodes config itself.
   
    "nodeAutoCreationPolicies": [
      {
        "pattern": ".*",
        "nodeType": "Queue",
        "attributes": {
          "durable": "true",
          "maximumMessageTtl": "3600000",
          "messageDurability": "ALWAYS",
          "messageGroupType": "STANDARD"
        },
        "createdOnPublish": "true",
        "createdOnConsume": "true"
      }
    ]
   
    I have included my complete config.json file below for reference.
   
    Thanks for any help on where to put this config!
    --
    Tom Jordahl
   
   
   
    {
      "name": "${broker.name}",
      "modelVersion": "7.1",
      "authenticationproviders": [
        {
          "name": "anonymous",
          "type": "Anonymous"
        },
        {
          "name": "plain",
          "type": "Plain",
          "users": [
            {
              "name": "admin",
              "type": "managed",
              "password": "love2fax"
            },
            {
              "name": "web",
              "type": "managed",
              "password": "love2fax"
            }
          ]
        }
      ],
      "brokerloggers": [
        {
          "name": "logfile",
          "type": "File",
          "durable": true,
          "compressOldFiles": true,
          "fileName": "${qpid.work_dir}${file.separator}log${file.separator}qpid.log",
          "maxFileSize": "100",
          "maxHistory": 7,
          "rollDaily": true,
          "rollOnRestart": true,
          "virtualHostLogEventExcluded": false,
          "brokerloginclusionrules": [
            {
              "name": "Operational",
              "type": "NameAndLevel",
              "level": "INFO",
              "loggerName": "qpid.message.*"
            },
            {
              "name": "Qpid",
              "type": "NameAndLevel",
              "level": "INFO",
              "loggerName": "org.apache.qpid.*"
            },
            {
              "name": "Root",
              "type": "NameAndLevel",
              "level": "WARN",
              "loggerName": "ROOT"
            },
            {
              "name": "Statistics",
              "type": "NameAndLevel",
              "level": "INFO",
              "loggerName": "qpid.statistics.*"
            }
          ]
        },
        {
          "name": "memory",
          "type": "Memory",
          "brokerloginclusionrules": [
            {
              "name": "Operational",
              "type": "NameAndLevel",
              "level": "INFO",
              "loggerName": "qpid.message.*"
            },
            {
              "name": "Qpid",
              "type": "NameAndLevel",
              "level": "INFO",
              "loggerName": "org.apache.qpid.*"
            },
            {
              "name": "Root",
              "type": "NameAndLevel",
              "level": "WARN",
              "loggerName": "ROOT"
            },
            {
              "name": "Statistics",
              "type": "NameAndLevel",
              "level": "INFO",
              "loggerName": "qpid.statistics.*"
            }
          ]
        }
      ],
      "plugins": [
        {
          "type": "MANAGEMENT-HTTP",
          "name": "httpManagement"
        }
      ],
      "ports": [
        {
          "name": "AMQP",
          "port": "${qpid.amqp_port}",
          "authenticationProvider": "anonymous",
          "virtualhostaliases": [
            {
              "name": "defaultAlias",
              "type": "defaultAlias"
            },
            {
              "name": "hostnameAlias",
              "type": "hostnameAlias"
            },
            {
              "name": "nameAlias",
              "type": "nameAlias"
            }
          ]
        },
        {
          "name": "HTTP",
          "type": "HTTP",
          "authenticationProvider": "anonymous",
          "port": "${qpid.http_port}",
          "protocols": [
            "HTTP"
          ]
        }
      ],
      "virtualhostnodes": [
        {
          "nodeAutoCreationPolicies": [
            {
              "pattern": ".*",
              "nodeType": "Queue",
              "attributes": {
                "durable": "true",
                "maximumMessageTtl": "3600000",
                "messageDurability": "ALWAYS",
                "messageGroupType": "STANDARD"
              },
              "createdOnPublish": "true",
              "createdOnConsume": "true"
            }
          ],
          "name": "qpid1",
          "type": "BDB_HA",
          "desiredState": "ACTIVE",
          "durable": "true",
          "context": {},
          "address": "qpid1:5700",
          "defaultVirtualHostNode": true,
          "designatedPrimary": false,
          "groupName": "AdobeSign",
          "helperAddress": "qpid1:5700]%>",
          "permittedNodes": [
            "qpid1:5700,qpid2:5700,qpid3:5700"
          ],
          "priority": "1",
          "quorumOverride": "1",
          "virtualHostInitialConfiguration": "{\"type\":\"BDB_HA\",\"context\":{},\"name\":\"qpid1\"}"
        }
      ]
    }
   
   


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Qpid Broker-J - Configuring nodeAutoCreationPolicies for an BDB_HA cluster from json

Oleksandr Rudyy
Hi Tom,
The node auto creation policies can be set on virtual host only, as it is
an attribute of virtual host. Adding policies into virtual host node
configuration does not have any effect. The settings are simply ignored and
removed on configuration update.
If you need to have the policies in broker initial configuration, you can
add them into virtual host inital configuration. Though, at the moment,
virtualHostInitialConfigurati can only have string values. Thus, you need
to stringify your policy json.
For example,
...
"virtualHostInitialConfiguration":
"{\"type\":\"BDB_HA\",\"context\":{},\"name\":\"$parent.name\",\"nodeAutoCreationPolicies\":
[{\"pattern\":\"*\",\"nodeType\":\"Queue\" ... }]}"
...

Kind Regards,
Alex

On Tue, 30 Apr 2019 at 19:44, Tom Jordahl <[hidden email]>
wrote:

> Added qualifying subject (sorry I missed it the first time).
>
> Anyone configure Broker-J with a json file on disk that might have some
> insight?
>
> --
> Tom
>
>
> On 4/26/19, 4:43 PM, "Tom Jordahl" <[hidden email]> wrote:
>
>     Hello,
>
>     I am configuring Qpid in a HA configuration (BDB_HA) via a Chef
> recipe, so I am using the {qpid.work_dir}/config.json file to create the
> initial configuration when Qpid starts up.
>
>     I would like the following Node Creation Policy to be configured in my
> Virtual Host, but when I add it to the config, it seems to be ignored.  I
> tried putting the entry in the broker configuration (i.e. right below the
> "name" entry in the top level config) and after using the REST API to get
> the virtual host config on a hand configured server, I moved it in to the
> virtualhostnodes config itself.
>
>     "nodeAutoCreationPolicies": [
>       {
>         "pattern": ".*",
>         "nodeType": "Queue",
>         "attributes": {
>           "durable": "true",
>           "maximumMessageTtl": "3600000",
>           "messageDurability": "ALWAYS",
>           "messageGroupType": "STANDARD"
>         },
>         "createdOnPublish": "true",
>         "createdOnConsume": "true"
>       }
>     ]
>
>     I have included my complete config.json file below for reference.
>
>     Thanks for any help on where to put this config!
>     --
>     Tom Jordahl
>
>
>
>     {
>       "name": "${broker.name}",
>       "modelVersion": "7.1",
>       "authenticationproviders": [
>         {
>           "name": "anonymous",
>           "type": "Anonymous"
>         },
>         {
>           "name": "plain",
>           "type": "Plain",
>           "users": [
>             {
>               "name": "admin",
>               "type": "managed",
>               "password": "love2fax"
>             },
>             {
>               "name": "web",
>               "type": "managed",
>               "password": "love2fax"
>             }
>           ]
>         }
>       ],
>       "brokerloggers": [
>         {
>           "name": "logfile",
>           "type": "File",
>           "durable": true,
>           "compressOldFiles": true,
>           "fileName":
> "${qpid.work_dir}${file.separator}log${file.separator}qpid.log",
>           "maxFileSize": "100",
>           "maxHistory": 7,
>           "rollDaily": true,
>           "rollOnRestart": true,
>           "virtualHostLogEventExcluded": false,
>           "brokerloginclusionrules": [
>             {
>               "name": "Operational",
>               "type": "NameAndLevel",
>               "level": "INFO",
>               "loggerName": "qpid.message.*"
>             },
>             {
>               "name": "Qpid",
>               "type": "NameAndLevel",
>               "level": "INFO",
>               "loggerName": "org.apache.qpid.*"
>             },
>             {
>               "name": "Root",
>               "type": "NameAndLevel",
>               "level": "WARN",
>               "loggerName": "ROOT"
>             },
>             {
>               "name": "Statistics",
>               "type": "NameAndLevel",
>               "level": "INFO",
>               "loggerName": "qpid.statistics.*"
>             }
>           ]
>         },
>         {
>           "name": "memory",
>           "type": "Memory",
>           "brokerloginclusionrules": [
>             {
>               "name": "Operational",
>               "type": "NameAndLevel",
>               "level": "INFO",
>               "loggerName": "qpid.message.*"
>             },
>             {
>               "name": "Qpid",
>               "type": "NameAndLevel",
>               "level": "INFO",
>               "loggerName": "org.apache.qpid.*"
>             },
>             {
>               "name": "Root",
>               "type": "NameAndLevel",
>               "level": "WARN",
>               "loggerName": "ROOT"
>             },
>             {
>               "name": "Statistics",
>               "type": "NameAndLevel",
>               "level": "INFO",
>               "loggerName": "qpid.statistics.*"
>             }
>           ]
>         }
>       ],
>       "plugins": [
>         {
>           "type": "MANAGEMENT-HTTP",
>           "name": "httpManagement"
>         }
>       ],
>       "ports": [
>         {
>           "name": "AMQP",
>           "port": "${qpid.amqp_port}",
>           "authenticationProvider": "anonymous",
>           "virtualhostaliases": [
>             {
>               "name": "defaultAlias",
>               "type": "defaultAlias"
>             },
>             {
>               "name": "hostnameAlias",
>               "type": "hostnameAlias"
>             },
>             {
>               "name": "nameAlias",
>               "type": "nameAlias"
>             }
>           ]
>         },
>         {
>           "name": "HTTP",
>           "type": "HTTP",
>           "authenticationProvider": "anonymous",
>           "port": "${qpid.http_port}",
>           "protocols": [
>             "HTTP"
>           ]
>         }
>       ],
>       "virtualhostnodes": [
>         {
>           "nodeAutoCreationPolicies": [
>             {
>               "pattern": ".*",
>               "nodeType": "Queue",
>               "attributes": {
>                 "durable": "true",
>                 "maximumMessageTtl": "3600000",
>                 "messageDurability": "ALWAYS",
>                 "messageGroupType": "STANDARD"
>               },
>               "createdOnPublish": "true",
>               "createdOnConsume": "true"
>             }
>           ],
>           "name": "qpid1",
>           "type": "BDB_HA",
>           "desiredState": "ACTIVE",
>           "durable": "true",
>           "context": {},
>           "address": "qpid1:5700",
>           "defaultVirtualHostNode": true,
>           "designatedPrimary": false,
>           "groupName": "AdobeSign",
>           "helperAddress": "qpid1:5700]%>",
>           "permittedNodes": [
>             "qpid1:5700,qpid2:5700,qpid3:5700"
>           ],
>           "priority": "1",
>           "quorumOverride": "1",
>           "virtualHostInitialConfiguration":
> "{\"type\":\"BDB_HA\",\"context\":{},\"name\":\"qpid1\"}"
>         }
>       ]
>     }
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Qpid Broker-J - Configuring nodeAutoCreationPolicies for an BDB_HA cluster from json

Tom Jordahl
Alex,

Thank so much, that worked exactly as I knew it could!

I filed a JIRA to put documentation of this in the Broker-J documentation:
   https://issues.apache.org/jira/browse/QPID-8307

--
Tom
 

On 5/1/19, 3:09 PM, "Oleksandr Rudyy" <[hidden email]> wrote:

    Hi Tom,
    The node auto creation policies can be set on virtual host only, as it is
    an attribute of virtual host. Adding policies into virtual host node
    configuration does not have any effect. The settings are simply ignored and
    removed on configuration update.
    If you need to have the policies in broker initial configuration, you can
    add them into virtual host inital configuration. Though, at the moment,
    virtualHostInitialConfigurati can only have string values. Thus, you need
    to stringify your policy json.
    For example,
    ...
    "virtualHostInitialConfiguration":
    "{\"type\":\"BDB_HA\",\"context\":{},\"name\":\"$parent.name\",\"nodeAutoCreationPolicies\":
    [{\"pattern\":\"*\",\"nodeType\":\"Queue\" ... }]}"
    ...
   
    Kind Regards,
    Alex
   
    On Tue, 30 Apr 2019 at 19:44, Tom Jordahl <[hidden email]>
    wrote:
   
    > Added qualifying subject (sorry I missed it the first time).
    >
    > Anyone configure Broker-J with a json file on disk that might have some
    > insight?
    >
    > --
    > Tom
    >
    >
    > On 4/26/19, 4:43 PM, "Tom Jordahl" <[hidden email]> wrote:
    >
    >     Hello,
    >
    >     I am configuring Qpid in a HA configuration (BDB_HA) via a Chef
    > recipe, so I am using the {qpid.work_dir}/config.json file to create the
    > initial configuration when Qpid starts up.
    >
    >     I would like the following Node Creation Policy to be configured in my
    > Virtual Host, but when I add it to the config, it seems to be ignored.  I
    > tried putting the entry in the broker configuration (i.e. right below the
    > "name" entry in the top level config) and after using the REST API to get
    > the virtual host config on a hand configured server, I moved it in to the
    > virtualhostnodes config itself.
    >
    >     "nodeAutoCreationPolicies": [
    >       {
    >         "pattern": ".*",
    >         "nodeType": "Queue",
    >         "attributes": {
    >           "durable": "true",
    >           "maximumMessageTtl": "3600000",
    >           "messageDurability": "ALWAYS",
    >           "messageGroupType": "STANDARD"
    >         },
    >         "createdOnPublish": "true",
    >         "createdOnConsume": "true"
    >       }
    >     ]
    >
    >     I have included my complete config.json file below for reference.
    >
    >     Thanks for any help on where to put this config!
    >     --
    >     Tom Jordahl
    >
    >
    >
    >     {
    >       "name": "${broker.name}",
    >       "modelVersion": "7.1",
    >       "authenticationproviders": [
    >         {
    >           "name": "anonymous",
    >           "type": "Anonymous"
    >         },
    >         {
    >           "name": "plain",
    >           "type": "Plain",
    >           "users": [
    >             {
    >               "name": "admin",
    >               "type": "managed",
    >               "password": "love2fax"
    >             },
    >             {
    >               "name": "web",
    >               "type": "managed",
    >               "password": "love2fax"
    >             }
    >           ]
    >         }
    >       ],
    >       "brokerloggers": [
    >         {
    >           "name": "logfile",
    >           "type": "File",
    >           "durable": true,
    >           "compressOldFiles": true,
    >           "fileName":
    > "${qpid.work_dir}${file.separator}log${file.separator}qpid.log",
    >           "maxFileSize": "100",
    >           "maxHistory": 7,
    >           "rollDaily": true,
    >           "rollOnRestart": true,
    >           "virtualHostLogEventExcluded": false,
    >           "brokerloginclusionrules": [
    >             {
    >               "name": "Operational",
    >               "type": "NameAndLevel",
    >               "level": "INFO",
    >               "loggerName": "qpid.message.*"
    >             },
    >             {
    >               "name": "Qpid",
    >               "type": "NameAndLevel",
    >               "level": "INFO",
    >               "loggerName": "org.apache.qpid.*"
    >             },
    >             {
    >               "name": "Root",
    >               "type": "NameAndLevel",
    >               "level": "WARN",
    >               "loggerName": "ROOT"
    >             },
    >             {
    >               "name": "Statistics",
    >               "type": "NameAndLevel",
    >               "level": "INFO",
    >               "loggerName": "qpid.statistics.*"
    >             }
    >           ]
    >         },
    >         {
    >           "name": "memory",
    >           "type": "Memory",
    >           "brokerloginclusionrules": [
    >             {
    >               "name": "Operational",
    >               "type": "NameAndLevel",
    >               "level": "INFO",
    >               "loggerName": "qpid.message.*"
    >             },
    >             {
    >               "name": "Qpid",
    >               "type": "NameAndLevel",
    >               "level": "INFO",
    >               "loggerName": "org.apache.qpid.*"
    >             },
    >             {
    >               "name": "Root",
    >               "type": "NameAndLevel",
    >               "level": "WARN",
    >               "loggerName": "ROOT"
    >             },
    >             {
    >               "name": "Statistics",
    >               "type": "NameAndLevel",
    >               "level": "INFO",
    >               "loggerName": "qpid.statistics.*"
    >             }
    >           ]
    >         }
    >       ],
    >       "plugins": [
    >         {
    >           "type": "MANAGEMENT-HTTP",
    >           "name": "httpManagement"
    >         }
    >       ],
    >       "ports": [
    >         {
    >           "name": "AMQP",
    >           "port": "${qpid.amqp_port}",
    >           "authenticationProvider": "anonymous",
    >           "virtualhostaliases": [
    >             {
    >               "name": "defaultAlias",
    >               "type": "defaultAlias"
    >             },
    >             {
    >               "name": "hostnameAlias",
    >               "type": "hostnameAlias"
    >             },
    >             {
    >               "name": "nameAlias",
    >               "type": "nameAlias"
    >             }
    >           ]
    >         },
    >         {
    >           "name": "HTTP",
    >           "type": "HTTP",
    >           "authenticationProvider": "anonymous",
    >           "port": "${qpid.http_port}",
    >           "protocols": [
    >             "HTTP"
    >           ]
    >         }
    >       ],
    >       "virtualhostnodes": [
    >         {
    >           "nodeAutoCreationPolicies": [
    >             {
    >               "pattern": ".*",
    >               "nodeType": "Queue",
    >               "attributes": {
    >                 "durable": "true",
    >                 "maximumMessageTtl": "3600000",
    >                 "messageDurability": "ALWAYS",
    >                 "messageGroupType": "STANDARD"
    >               },
    >               "createdOnPublish": "true",
    >               "createdOnConsume": "true"
    >             }
    >           ],
    >           "name": "qpid1",
    >           "type": "BDB_HA",
    >           "desiredState": "ACTIVE",
    >           "durable": "true",
    >           "context": {},
    >           "address": "qpid1:5700",
    >           "defaultVirtualHostNode": true,
    >           "designatedPrimary": false,
    >           "groupName": "AdobeSign",
    >           "helperAddress": "qpid1:5700]%>",
    >           "permittedNodes": [
    >             "qpid1:5700,qpid2:5700,qpid3:5700"
    >           ],
    >           "priority": "1",
    >           "quorumOverride": "1",
    >           "virtualHostInitialConfiguration":
    > "{\"type\":\"BDB_HA\",\"context\":{},\"name\":\"qpid1\"}"
    >         }
    >       ]
    >     }
    >
    >
    >
    >
   


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]