juntossomosmais / django-outbox-pattern Goto Github PK
View Code? Open in Web Editor NEWA django application to make it easier to use the transactional outbox pattern
License: MIT License
A django application to make it easier to use the transactional outbox pattern
License: MIT License
Hello everyone,
I have identified an issue with our library that is causing it to unnecessarily consume resources by allowing the message tables to grow indefinitely. The problem is that the library is not currently set up to automatically delete old messages, which is resulting in a large and ever-growing database.
To address this issue, I propose that we implement a solution that will automatically delete messages after a certain period of time. I suggest setting a default retention period of 7 days, but also providing an option in the Django settings for users to configure the number of days to retain messages.
By implementing this solution, we can significantly reduce the amount of storage and processing power required to maintain our message tables, leading to improved performance and efficiency for our users. I am happy to take on the task of implementing this feature and would appreciate any feedback or suggestions you may have.
Hello everyone,
I have noticed that our library is currently running queries on the msg_id field, which is not indexed. This can become problematic as the message table grows larger, resulting in slower query times and increased load on the database.
To address this issue, I suggest that we create a unique index on the msg_id column. This will significantly improve query performance by reducing the amount of time it takes to search for messages, as well as minimizing the amount of resources needed by the database.
Hello there!
I encountered an error when trying to access the admin page of menu Django Admin > DJANGO_OUTBOX_PATTERN > Receiveds. The error is caused by missing headers that are required for a successful request.
After examining the code, I suspect that the issue may be related to the model field accepting null values, as shown in line 52 of the models.py file. Ideally, the property should exist here, as shown in line 61 of the same file.
However, if the header doesn't exist, it will raise an AttributeError.
Such an implementation looks like a bottleneck
published = self.published_class.objects.filter(
status=StatusChoice.SCHEDULE, expires_at__gte=timezone.now()
)
for message in published:
try:
attempts = self.producer.send(message)
except ExceededSendAttemptsException as exc:
logger.exception(exc)
message.retry = exc.attempts
message.status = StatusChoice.FAILED
message.expires_at = timezone.now() + timedelta(15)
self.stdout.write(f"Message no published with body:\n{message.body}")
else:
message.retry = attempts
message.status = StatusChoice.SUCCEEDED
self.stdout.write(f"Message published with body:\n{message.body}")
finally:
message.save()
because new messages can arrive faster than once a second
def _waiting():
sleep(1)
while the solution does not allow itself to be scaled in any way; you cannot simply launch another Publisher, otherwise the message will be sent twice
The library needs to guarantee support for some Python and Django versions with tests.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.