energywebfoundation / ocn-node

Apache License 2.0
5 stars 4 forks source link

hubclientinfo PUSH requests #3

Closed ewf-devops closed 4 years ago

ewf-devops commented 4 years ago

Original report by John Henderson (Bitbucket: [John Henderson](https://bitbucket.org/John Henderson), GitHub: jrhender).


As per section 15.2.1 of OCPI 2.2, the HubClientInfo module contains a Push model. In order to provide all of the functionality of OCPU, the ocn-client should implement this Push model.

ewf-devops commented 4 years ago

Original comment by John Henderson (Bitbucket: [John Henderson](https://bitbucket.org/John Henderson), GitHub: jrhender).


This may be complex in OCN’s case due there being both connections on both the local OCPI platform as well as remote OCPI connections through OCN. (Perhaps this is why this wasn’t implemented already). I am thinking though that it would be valuable just to start with push to local OCPI, with a view to possibly extending to pushing to remote connections in the future.

I am considering implementing this using Spring Data @DomainEvents (https://www.baeldung.com/spring-data-ddd). My thinking is that an observer/pub-sub of some kind will make it easier to implement this with minimal coupling/changes to the other OCPI module implementations. Any thoughts on this?

ewf-devops commented 4 years ago

Original comment by Adam Staveley (Bitbucket: [Adam Staveley](https://bitbucket.org/Adam Staveley), GitHub: adamstaveley).


Yes, you are right, we have not yet implemented this due to the complexity. It is in our internal backlog and scheduled for around January time. If you wish to submit a first implementation you are very welcome!

ewf-devops commented 4 years ago

Original comment by Adam Staveley (Bitbucket: [Adam Staveley](https://bitbucket.org/Adam Staveley), GitHub: adamstaveley).


https://github.com/ocpi/ocpi/blob/master/releases/2.2/mod_hub_client_info.asciidoc for reference

ewf-devops commented 4 years ago

Original comment by John Henderson (Bitbucket: [John Henderson](https://bitbucket.org/John Henderson), GitHub: jrhender).


@{5c0e56819aeccc769f3342d4} Hi Adam, a couple questions for you when you have a moment. Both are in the context of HubClientInfo push model.

  1. If a platform has updated ClientInfo, should a notification be sent to that same platform or should it be excluded from the notification? My opinion is that it should be excluded but I don’t think that is in the OCPI spec.
  2. Should a given notification be sent a single time to a platform or should the notification be sent to each role/party in a platform? If it is a single notification, what should be used for the OCPI-to-party-id and OCPI-to-country-code request headers? I think the straightforward approach is to send a notification to each role/party in a platform, but I am wondering if the platform would consider that to be redundant notifications.

Apologies if you’re not the correct person to ask or unsure. It should be easy to change to change this behaviour later, but I thought it would be good to get the questions out there.

ewf-devops commented 4 years ago

Original comment by Adam Staveley (Bitbucket: [Adam Staveley](https://bitbucket.org/Adam Staveley), GitHub: adamstaveley).


Hi John,

I would say:

  1. I agree, I think we can exclude the sending platform from being notified.
  2. I also think it’s redundant to send the notification to each party within a platform. Assuming the platform has a single hubclientinfo receiver interface that operates on behalf of any number of parties within the platform, we could simply not send any OCPI routing headers when sending these notifications out.

ewf-devops commented 4 years ago

Original comment by Adam Staveley (Bitbucket: [Adam Staveley](https://bitbucket.org/Adam Staveley), GitHub: adamstaveley).


The solution, from John Henderson, has been included in v1.1.0 RC0, which can be found in the develop branch.