I would like to use mercure with rabbitmq, use rabbitmq instead of mercury hub. Is this possible ? Maybe in Async
I tried this little code but it doesn’t work
My controller
$update = new Update(
'https://example.com/books/1',
json_encode(['status' => 'OutOfStock'])
);
$bus->dispatch($update);
Messenger.yaml :
routing:
SymfonyComponentMercureUpdate: async
Twig :
{% block javascripts %}
<script>
const eventSource = new EventSource("{{ mercure('https://example.com/books/1')|escape('js') }}");
eventSource.onmessage = event => {
console.log(JSON.parse(event.data));
}
</script>
{% endblock %}
Error in browser console :
Mixed Content: The page at ‘https://localhost/home’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint
Thanks for your help
New contributor
Hydro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.