Open torgeir opened 8 years ago
Hey it looks like this is a bug with our deepMerge
implementation, but it also seems to work if you just flip the order of the merged objects:
const client = new Amqp.Client(Amqp.Policy.merge(Amqp.Policy.QpidJava, {
connect: {
options: {
sslOptions: {
keyFile: keyFilePath,
certFile: certFilePath
}
}
}
}));
Sorry for the confusion, maybe @noodlefrenzy can speak to this - otherwise we can change the docs to reflect this form.
Alright.
it also seems to work if you just flip the order of the merged objects
But that would merge the other way around, no? My extensions into the QpidJava object, which I was trying to avoid.
yup totally :) give me a minute maybe I can solve this quickly. Another temporary alternative is that the Policy
class itself takes overrides as its first argument, so you can just do let myPolicy = new Policy({ /* all the overrides from the existing qpidjava policy */});
Hehe, np. An Object.assign
will do for now :) Thanks
@torgeir oh how I desperately wish to update the codebase to es6... that's sort of on the docket for a v4, but for now we have to deal with all this
Just starting out with node-amqp10 I was trying to create a QpidJava policy with some of the
sslOptions
overridden.Browsing through the code I got the impression that something along the lines of this would work. Should this be working, or am I misunderstanding things?
It dies with
Fell back to this, which does seems to work, but is unfortunate as it overrides the defaults.