rollno748 / Jmeter-pubsub-sampler

JMeter plugin to Publish and Subscribe Messages to GCP
MIT License
12 stars 5 forks source link

Add support for service account file #6

Open ametelski opened 2 years ago

ametelski commented 2 years ago

See docs https://cloud.google.com/pubsub/docs/quickstart-client-libraries#before-you-begin

rollno748 commented 2 years ago

Hello,

Rightnow, If you copy the key value pair to the respective fields, it should work. Do you want the feature to parse the json directly and autopopulate values to its respective fields ?

Thanks

ametelski commented 2 years ago

Hi,

I plan to run this on our build server and we will be leveraging the environment variable GOOGLE_APPLICATION_CREDENTIALS to pass the credentials as outlined in step 7 of the docs. Looking at your code I think we just need a option to omit this line. https://github.com/rollno748/Jmeter-pubsub-sampler/blob/72c221916a59891d0924434863df3fdd4e4d51ce/src/main/java/com/di/jmeter/pubsub/config/PublisherConfig.java#L98

rollno748 commented 2 years ago

I don't think GOOGLE_APPLICATION_CREDENTIALS environment variables can be pulled out directly. The GOOGLE_APPLICATION_CREDENTIALS is something used by the applications during the startup to set it as environment variables.

Why can't you use a JSON (K,V) pairs for your test - > That should work properly I see no reason to add that option, because JMeter runs on a separate machine - If you pass the credentials.json to config element, you should be able to send events to teh topic

Correct me if I am wrong