Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/529#discussion_r72617680
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java
 ---
    @@ -366,6 +371,14 @@ private int receiveFlowFiles(final Transaction 
transaction, final ProcessContext
             return flowFilesReceived.size();
         }
     
    +    private String createTransitUri(Transaction transaction, String 
sourceFlowFileIdentifier) {
    +        if (transaction instanceof CustomTransitUriTransaction) {
    --- End diff --
    
    @ijokarumawak I think I like this a little better, but it still feels off 
to me. Transaction is an interface, so I don't like inspecting the type of the 
interface in order to determine how to interact with it. What if instead of 
taking this approach, we update the Communicant interface to have a 
`createTransitUri(String sourceFlowFileIdentifier)` method? Then, we can just 
call `transaction.getCommunicant().createTransitUri(sourceFlowFileIdentifier)`. 
The raw socket transaction and the HTTP Transaction can then wrap the `Peer` 
class as necessary to ensure that the appropriate URI is created. This allows 
us to get away from having to have special interfaces that extend Transaction 
as well as having to inspect the Transaction to find out how to handle it. It 
also avoids modifying the `Transaction` interface, which is sort of the 'main' 
interface for Site-to-Site communications. Thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to