Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add options at the publish level of the gps sender #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DamienLinux
Copy link

This is a proposal to add options to the publish method of google pub/sub on the GpsSender

I added a specific stamp for this.

I propose it in the need on a project to use this in addition to the orderingKey :
gps->publish(messageBuilder->build, ["enableMessageOrdering" => true]);

Damien AVETTA-RAYMOND added 2 commits July 31, 2023 14:15
$this->pubSubClient
->topic($this->gpsConfiguration->getTopicName())
->publish($messageBuilder->build())
->publish($messageBuilder->build(), $options)
Copy link
Contributor

Choose a reason for hiding this comment

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

$options might be undefined if GpsSenderOptionsStamp is not in the envelope

Copy link
Member

Choose a reason for hiding this comment

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

yes, please put the $options = [] before the if statement or put here $options ?? []

$this->pubSubClient
->topic($this->gpsConfiguration->getTopicName())
->publish($messageBuilder->build())
->publish($messageBuilder->build(), $options)
Copy link
Member

Choose a reason for hiding this comment

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

yes, please put the $options = [] before the if statement or put here $options ?? []

/**
* @param array<string, mixed> $options
*/
public function __construct(array $options) {
Copy link
Member

Choose a reason for hiding this comment

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

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