Skip to content
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

SQS/SNS - MSMQ - Router not working behind a proxy #44

Open
rhg1968 opened this issue Sep 13, 2021 · 1 comment
Open

SQS/SNS - MSMQ - Router not working behind a proxy #44

rhg1968 opened this issue Sep 13, 2021 · 1 comment

Comments

@rhg1968
Copy link

rhg1968 commented Sep 13, 2021

I have successfully implemented an endpoint (v7.5.0 using .net 4.8) that runs on a windows server and utilizes the router to bridge between the MSMQ and AWS. It runs correctly from multiple developers machines but we have into some issues moving it into our development environment.
In our dev environment we have added the SQS queues urls to the proxy and the generic SNS url us-east-2 to the proxy as well.
I also have both the router and endpoint itself setting up the client factory to configure to use the SQS client with a SQS config object to set the properties for the proxy.

When we run this all the SQS queues get created properly from behind the proxy, but the SNS topics and subscriptions are not created from behind the proxy. Looking at CloudTrail I don’t see any SNS activity except from our local machines.

I wanted to see if there is anything special with the SNS component that needs to be configured differently for it to work from behind a proxy. I am already doing custom config on the router so it will work based on previous responses to questions I have posted in the forums.

            extensions.ClientFactory(() => {
            return (!useProxy)? new AmazonSQSClient(): new AmazonSQSClient(new AmazonSQSConfig
            {
                ProxyHost = proxyUrl,
                ProxyPort = proxyPort
            });
        });

        var ctor = typeof(MessageMetadataRegistry).GetConstructor(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, new[] { typeof(Func<Type, bool>) }, null);

#pragma warning disable CS0618 // Type or member is obsolete
settings.Set(ctor.Invoke(new object[] { (Func<Type, bool>)isMessageType }));
#pragma warning restore CS0618 // Type or member is obsolete

Update - 9/13/2021
It appears as though the SQS traffic is https and is successfully going through the proxy.
The SNS traffic appears to be going through the firewall as tcp over port 443.

@rhg1968
Copy link
Author

rhg1968 commented Sep 15, 2021

Got it working with help from the community and Particular.
Just has to also configure SNS with the client factory

transport.ClientFactory(()=>new AmazonSimpleNotificationServiceClient(
new AmazonSimpleNotificationServiceConfig
{
ProxyHost = proxyUrl,
ProxyPort = proxyPort
}
));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant