Skip to content

Conversation

@alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Apr 30, 2020

This extends the client API with an ability to handle an error returned when posting a command or another message for asynchronous processing:

  • ServerErrorHandler interface was introduced. It accepts io.spine.base.Error obtained from the server-side in an Ack.
  • The Client got methods for customising error handlers
    • onStreamingError() — for handing errors obtained from gRPC.
    • onServerError() — for handling Error obtained as a part of an Ack.
      These handlers will be passed as default values for ClientRequests produced by the client.
  • The ClientRequest class also got onStreamingError() and onServerError() methods for fine tuning of handlers that may be necessary for a specific request.

Other changes

  • LoggingHandler interface is now more general and does not contain an association with a type. LoggingHandlerWithType is introduced for handlers that do need such an association.
  • Removed redundant methods for obtaining a tenant from a signal.
  • The Signal interface got the type() method which obtains the type of the enclosed message.
  • Added WithTime interface for encapsulating obtaining Timestamp, Instant and time range checking.
  • Added WithActor interface for encapsulating obtaining ActorContext and its properties.
  • Added ContextWithActor interface which is common base for CommandContext and EventContext.
  • CommandContext got a mix-in so that it's easier to obtain a user or a tenant of a command.
  • Response got a mix-in for easier checking of its type.
  • The internal interface MessageRejection was renamed to MessageError to avoid confusion with real rejections. It was also moved under the server package.
  • The internal MessageInvalid interface was moved to the server package.

Deprecations

  • @ByField was deprecated because @Subscribe.filter() which uses it was deprecated earlier.
  • Command.time() was deprecated in favour of WithTime.timestamp().

…r-acks

# Conflicts:
#	license-report.md
#	pom.xml
#	version.gradle
@codecov
Copy link

codecov bot commented Apr 30, 2020

Codecov Report

Merging #1270 into master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #1270   +/-   ##
=========================================
  Coverage     91.12%   91.12%           
  Complexity     4698     4698           
=========================================
  Files           605      605           
  Lines         14921    14921           
  Branches        852      852           
=========================================
  Hits          13597    13597           
  Misses         1058     1058           
  Partials        266      266           

@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review May 13, 2020 15:05
Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-yevsyukov LGTM in general. Please see my comments.

@alexander-yevsyukov alexander-yevsyukov merged commit b2819f3 into master May 14, 2020
@alexander-yevsyukov alexander-yevsyukov deleted the handle-error-acks branch August 7, 2020 14:06
@dmitrykuzmin dmitrykuzmin mentioned this pull request Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants