Admiral-Piett / goaws

AWS (SQS/SNS) Clone for Development testing
MIT License
770 stars 145 forks source link

Support mode to generate queueUrl from incoming request, rather than static hostname. #219

Open nhoughto opened 4 years ago

nhoughto commented 4 years ago

The current behaviour as I understand it is to configure a static hostname (or allow it to default to localhost) and then that value is used to create the queueUrl that clients will follow to do SQS ReceiveMessage etc.

This works in simple situations but breaks scenarios where a single goaws instance might have multiple ingress paths, think Kubernetes Service vs Kubernetes Ingress vs Kubernetes NodePort.. there are lots of reasons this can happen.

To solve this problem it would be great if you could configure a mode where the hostname used in the queueUrl is derived from the incoming request rather than from configuration or defaulted. This limits the number of "environments" you can have, I expect you can only have 1 in "derive" mode, but i'd expect most users have just one environment anyway.

nhoughto commented 4 years ago

Seems to be mostly solved by https://github.com/p4tin/goaws/pull/213 That appears to be changing the default behavour from localhost to using the host header tho, which is possibly undesirable.

I made an alternative version of the fix too here:

https://github.com/bsycorp/goaws/commit/2f3217691c2e21367175ecf34c06a9a31cc6a0ae

p4tin commented 4 years ago

PR?

nhoughto commented 3 years ago

way late 😬 https://github.com/p4tin/goaws/pull/234