Closed Thelin90 closed 2 years ago
I solved the problem by doing:
├── worker
│ ├── __init__.py
│ └── app.py
poetry run faust --datadir=worker-1/ -A main worker -l info
__init__.py
from worker import app
__all__ = ["app"]
app.py
import faust
app = faust.App(
"main",
broker="kafka://localhost:31659",
value_serializer="raw",
)
yahoo_topic = app.topic("yahoo-finance-quote-stream-api")
@app.agent(yahoo_topic)
async def process(yahoo):
async for value in yahoo:
print(value)
if __name__ == "__main__":
app.main()
It feels however strange to me I had to modify the __init__.py
.
Ah well I can use it this way...
Checklist
master
branch of Faust.Kafka
Kafka is running within a
strimzi
operator in a localk8s
cluster, and it works100%
fine, no issues at all to consume either console or from other applications.Steps to reproduce
Or
Structure
Code
Expected behavior
Worker starting.
Actual behavior
For some reason, I keep getting:
ModuleNotFoundError: No module named 'main_app'
Full traceback
Similar issues
https://github.com/robinhood/faust/issues/152
But this is too old to be correlated to my issue.
Versions
faust-streaming = { git = "https://github.com/faust-streaming/faust.git", branch = "master" }