-
Notifications
You must be signed in to change notification settings - Fork 1
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
Faststream docs #403
base: fastapi-poc
Are you sure you want to change the base?
Faststream docs #403
Changes from 2 commits
ae8523b
c5cf21e
eced3dd
9fbf35d
1fe0901
8ff4f45
c5afcf9
2a552f7
2eaad24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"asyncapi": "2.6.0", | ||
"defaultContentType": "application/json", | ||
"info": { | ||
"title": "FastStream", | ||
"version": "0.1.0", | ||
"description": "" | ||
}, | ||
"servers": { | ||
"development": { | ||
"url": "amqps://org-agent-a7ba9504-a02f-40c8-8c46-145b4ff5765b:B-8Eflf%7Bd5y_%23k_-Lcs%5CVYcN8Osf,!%40l%3CB=dE9j515Yj%3Ec%5Bb4POG2%5D*_ja%60%5BV%[email protected]:5671/", | ||
"protocol": "amqps", | ||
"protocolVersion": "0.9.1" | ||
} | ||
}, | ||
"channels": {}, | ||
"components": { | ||
"messages": {}, | ||
"schemas": {} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
asyncapi: 2.6.0 | ||
defaultContentType: application/json | ||
info: | ||
title: FastStream | ||
version: 0.1.0 | ||
description: "" | ||
servers: | ||
development: | ||
url: amqps://org-agent-a7ba9504-a02f-40c8-8c46-145b4ff5765b:XI,IT)U5%5Bd%5C%23%22$%40%3F0SwhhdF0gp%60z(1-WHE%3Fu%230tTm6N%3C%5DQLjg;*v6%22%7DU%7D4%5D%7CM%[email protected]:5671/ | ||
protocol: amqps | ||
protocolVersion: 0.9.1 | ||
channels: {} | ||
components: | ||
messages: {} | ||
schemas: {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,7 +191,9 @@ class GXAgent: | |
_PYPI_GX_AGENT_PACKAGE_NAME = "great_expectations_cloud" | ||
_PYPI_GREAT_EXPECTATIONS_PACKAGE_NAME = "great_expectations" | ||
|
||
def __init__(self: Self): | ||
def __init__(self: Self, app: FastStream, broker: RabbitBroker) -> None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a breaking change for runner. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just discovered the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TrangPham |
||
self.app = app | ||
self.broker = broker | ||
agent_version: str = self.get_current_gx_agent_version() | ||
great_expectations_version: str = self._get_current_great_expectations_version() | ||
print(f"GX Agent version: {agent_version}") | ||
|
@@ -239,15 +241,11 @@ def run(self) -> None: | |
async def _listen(self) -> None: | ||
"""Manage connection lifecycle.""" | ||
try: | ||
broker = RabbitBroker( | ||
url=str(self._config.connection_string), | ||
) | ||
app = FastStream(broker) | ||
queue = RabbitQueue(name=self._config.queue, durable=True, passive=True) | ||
print("Queue is valid.") | ||
|
||
# FastStream declares default exchange if not provided | ||
@broker.subscriber(queue, retry=MAX_DELIVERY) | ||
@self.broker.subscriber(queue, retry=MAX_DELIVERY) | ||
async def handle_me( | ||
msg: dict[str, Any], correlation_id: str = Context("message.correlation_id") | ||
) -> None: | ||
|
@@ -542,3 +540,7 @@ def _update_headers_agent_patch( | |
# TODO: this is relying on a private implementation detail | ||
# use a public API once it is available | ||
http._update_headers = _update_headers_agent_patch | ||
|
||
|
||
broker = RabbitBroker(str(GXAgent._get_config().connection_string)) | ||
app: Final[FastStream] = FastStream(broker) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To see what these docs would look like live, go to the asyncapi studio and paste them into the editor.
https://studio.asyncapi.com/