Skip to content

🚌 Google Cloud Pub Sub transport for Rebus (under development)

License

Notifications You must be signed in to change notification settings

rebus-org/Rebus.GoogleCloudPubSub

Repository files navigation

Rebus.GoogleCloudPubSub

install from nuget

Provides a Google Cloud Pub/Sub-based transport implementation for Rebus.

It's just

// ensure that the GOOGLE_APPLICATION_CREDENTIALS 
// environment variable has been set, and then:

Configure.With(...)
	.Transport(t => t.UsePubSub("your_queue"))
	.(...)
	.Start();

or

// ensure that the GOOGLE_APPLICATION_CREDENTIALS 
// environment variable has been set, and then:

var bus = Configure.With(...)
	.Transport(t => t.UsePubSubAsOneWayClient())
	.(...)
	.Start();

and off you go! 🚀

Development and testing

Do the changes you please and make sure all tests run with success. Most tests have a dependency on GoogleCloudPubSub. A dependency which can be resolved either by having a pub-sub project in Google Cloud, or by running a local emulator.

Run tests using docker-compose and a local emulator

The docker-compose setup takes care of all necessities and outputs the test results to screen and a to current directory in JUnit Xml format.

docker-compose build
docker-compose up

Expected output:

tests_1   | JunitXML Logger - Results File: /tmp/testresults.run/Rebus.GoogleCloudPubSub.Tests-test-result.xml
tests_1   |
tests_1   | Passed!  - Failed:     0, Passed:    15, Skipped:     0, Total:    15, Duration: 14 m 54 s - /app/Rebus.GoogleCloudPubSub.Tests/bin/Debug/net6.0/Rebus.GoogleCloudPubSub.Tests.dll (net6.0)
rebusgooglecloudpubsub_tests_1 exited with code 0

Run tests using a local emulator

Run the pubsub emulator as you please. Make sure to put appropriate values into the environment variables before running the tests:

  • PUBSUB_EMULATOR_HOST (the address the emulator is accessible at)
  • PUBSUB_PROJECT_ID (the project id the emulator is configured with)

Run tests using GooglePubSub cloud service

Make sure the environment variable GOOGLE_APPLICATION_CREDENTIALS points at your local google-application-credentials file.

(If both PUBSUB_EMULATOR_HOST and PUBSUB_PROJECT_ID environment variables are set, setting the GOOGLE_APPLICATION_CREDENTIALS will have no effect)


About

🚌 Google Cloud Pub Sub transport for Rebus (under development)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •