You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Pushkara R <pu...@gmail.com> on 2017/05/04 16:49:27 UTC

Issues with creating and connecting RPG programmatically

Hi,

I am trying to write a function that takes two parameters, a processor ID
in machine A and an input port in machine B and creates an RPG in machine B
which connects the above to.

Now, how I am doing that is
1. A POST to the
*/nifi-api/process-groups/<rootprocessgroupid>/remote-process-groups*
endpoint to create an RPG and retrieve the ID of that RPG
2. A POST to the */nifi-api/process-groups/<rootprocessgroupid>/connections
*endpoint to create a connection between the processor and the input port.
the processorID and the ID of the input port are being provided along with
the list of the relationships.
3. A final PUT to */nifi-api/remote-process-groups/<rpgid> *to enable the
transmission between the machines*.*

Now, the function always throws errors in step 2. A 409 is thrown for the
POST request with the error being 'Unable to find specified destination'.
(though refreshing the canvas on machine 1 shows the rpg having been
created)
However, when I manually run the steps 2 and 3 afterwards, with the same
rpgid, the connection happens.

Now, I'm not sure if this is a synchronization issue or not, but I want to
figure it out because I would not want to separate out steps 1 2 and 3.
Could somebody point out what could be the issue here?

Pushkar

PS - the post messages for steps 2 are the same when the api is called from
within the function and manually.

Re: Issues with creating and connecting RPG programmatically

Posted by Pushkara R <pu...@gmail.com>.
Thanks a lot Matt

-Pushkar

On Thu, May 4, 2017 at 11:00 PM, Matt Gilman <ma...@gmail.com>
wrote:

> I've responded to the question on StackOverflow [1].
>
> Thanks
>
> Matt
>
> [1]
> http://stackoverflow.com/questions/43788780/nifi-issues-with-creating-and-
> connecting-rpg-programmatically/43789310#43789310
>
> On Thu, May 4, 2017 at 12:49 PM, Pushkara R <pu...@gmail.com> wrote:
>
> > Hi,
> >
> > I am trying to write a function that takes two parameters, a processor ID
> > in machine A and an input port in machine B and creates an RPG in
> machine B
> > which connects the above to.
> >
> > Now, how I am doing that is
> > 1. A POST to the
> > */nifi-api/process-groups/<rootprocessgroupid>/remote-process-groups*
> > endpoint to create an RPG and retrieve the ID of that RPG
> > 2. A POST to the */nifi-api/process-groups/<rootprocessgroupid>/
> connections
> > *endpoint to create a connection between the processor and the input
> > port. the processorID and the ID of the input port are being provided
> along
> > with the list of the relationships.
> > 3. A final PUT to */nifi-api/remote-process-groups/<rpgid> *to enable
> the
> > transmission between the machines*.*
> >
> > Now, the function always throws errors in step 2. A 409 is thrown for the
> > POST request with the error being 'Unable to find specified destination'.
> > (though refreshing the canvas on machine 1 shows the rpg having been
> > created)
> > However, when I manually run the steps 2 and 3 afterwards, with the same
> > rpgid, the connection happens.
> >
> > Now, I'm not sure if this is a synchronization issue or not, but I want
> to
> > figure it out because I would not want to separate out steps 1 2 and 3.
> > Could somebody point out what could be the issue here?
> >
> > Pushkar
> >
> > PS - the post messages for steps 2 are the same when the api is called
> > from within the function and manually.
> >
>

Re: Issues with creating and connecting RPG programmatically

Posted by Matt Gilman <ma...@gmail.com>.
I've responded to the question on StackOverflow [1].

Thanks

Matt

[1]
http://stackoverflow.com/questions/43788780/nifi-issues-with-creating-and-connecting-rpg-programmatically/43789310#43789310

On Thu, May 4, 2017 at 12:49 PM, Pushkara R <pu...@gmail.com> wrote:

> Hi,
>
> I am trying to write a function that takes two parameters, a processor ID
> in machine A and an input port in machine B and creates an RPG in machine B
> which connects the above to.
>
> Now, how I am doing that is
> 1. A POST to the
> */nifi-api/process-groups/<rootprocessgroupid>/remote-process-groups*
> endpoint to create an RPG and retrieve the ID of that RPG
> 2. A POST to the */nifi-api/process-groups/<rootprocessgroupid>/connections
> *endpoint to create a connection between the processor and the input
> port. the processorID and the ID of the input port are being provided along
> with the list of the relationships.
> 3. A final PUT to */nifi-api/remote-process-groups/<rpgid> *to enable the
> transmission between the machines*.*
>
> Now, the function always throws errors in step 2. A 409 is thrown for the
> POST request with the error being 'Unable to find specified destination'.
> (though refreshing the canvas on machine 1 shows the rpg having been
> created)
> However, when I manually run the steps 2 and 3 afterwards, with the same
> rpgid, the connection happens.
>
> Now, I'm not sure if this is a synchronization issue or not, but I want to
> figure it out because I would not want to separate out steps 1 2 and 3.
> Could somebody point out what could be the issue here?
>
> Pushkar
>
> PS - the post messages for steps 2 are the same when the api is called
> from within the function and manually.
>

Re: Issues with creating and connecting RPG programmatically

Posted by Matt Gilman <ma...@gmail.com>.
I've responded to the question on StackOverflow [1].

Thanks

Matt

[1]
http://stackoverflow.com/questions/43788780/nifi-issues-with-creating-and-connecting-rpg-programmatically/43789310#43789310

On Thu, May 4, 2017 at 12:49 PM, Pushkara R <pu...@gmail.com> wrote:

> Hi,
>
> I am trying to write a function that takes two parameters, a processor ID
> in machine A and an input port in machine B and creates an RPG in machine B
> which connects the above to.
>
> Now, how I am doing that is
> 1. A POST to the
> */nifi-api/process-groups/<rootprocessgroupid>/remote-process-groups*
> endpoint to create an RPG and retrieve the ID of that RPG
> 2. A POST to the */nifi-api/process-groups/<rootprocessgroupid>/connections
> *endpoint to create a connection between the processor and the input
> port. the processorID and the ID of the input port are being provided along
> with the list of the relationships.
> 3. A final PUT to */nifi-api/remote-process-groups/<rpgid> *to enable the
> transmission between the machines*.*
>
> Now, the function always throws errors in step 2. A 409 is thrown for the
> POST request with the error being 'Unable to find specified destination'.
> (though refreshing the canvas on machine 1 shows the rpg having been
> created)
> However, when I manually run the steps 2 and 3 afterwards, with the same
> rpgid, the connection happens.
>
> Now, I'm not sure if this is a synchronization issue or not, but I want to
> figure it out because I would not want to separate out steps 1 2 and 3.
> Could somebody point out what could be the issue here?
>
> Pushkar
>
> PS - the post messages for steps 2 are the same when the api is called
> from within the function and manually.
>