edge micro coresident plan in PCF setup issues

I tried a for a few hours, following step by step the instructions here: https://github.com/apigee/cloud-foundry-apigee/tree/master/samples/coresident-sample

I was trying this with a spring boot app. After deploying the spring boot app, a tomcat rest service running on port 8080 would come up but there was no hint of Edge micro running.

I engage with Apigee and @Ankur Shukla helped me out, these are a few of the things we found getting it running.

First when you configure your edge micro locally you need to run EM on port 8080 so:

edgemicro:  port: 8080<br />  max_connections: 1000<br />  config_change_poll_interval: 600<br />  logging:    level: info<br />    to_console: true<br />    dir: /var/tmp<br />    stats_log_interval: 60<br />    rotate_interval: 24<br />  plugins:    sequence:- oauth

notice I also am logging to console with info, which helped debug a lot

Next issue, I was specifying my app to run on port 8081 in the Application.properties. Now not sure if this was needed in the end but we did also add this in the env variables to make sure it was running on port 8081

env:  JAVA_OPTS: '-Dserver.port=8081'SPRING_PROFILES_ACTIVE: sa<br />  APIGEE_MICROGATEWAY_CONFIG_DIR: config<br />  APIGEE_MICROGATEWAY_CUSTOM: |<br />                                   {"policies":<br />                                        {<br />                                        "oauth":<br />                                            {<br />                                            "allowNoAuthorization": false,<br />                                            "allowInvalidAuthorization": false,<br />                                            "verify_api_key_url": "https://yourorg-env.apigee.net/edgemicro-auth/verifyApiKey"<br />                                            }<br />                                        },<br />                                        "sequence": ["oauth"]<br />                                        }

The third issue we had to overcome was that edge micro would start up but wasn't appearing to forward the traffic to the app running on 8081. Turns out you have to have the APIGEE_MICROGATEWAY_CUSTOM in the manifest as shown above. It isn't applying it from the config file.

With these edits I was able to get the coresident working in a PCF container. This is with the 2.5.8 Edge micro and 3.0 of the Apigee Service Broker tile.

Lastly the cors plugin crashes edge micro when used with coresident

2 2 164
2 REPLIES 2

Thanks for Summarizing @Jeff Bogenschneider and am glad we were able to get this running.

Just a note on the ENV variable we setup - The JAVA_OPTS:'-Dserver.port=8081' will be required as we need the target app to run on a fixed port but not on 8080 (CF default for apps). This is same port number is later passed to apigee-bind-mgc command when we do our service binding.

Not applicable

Good stuff. Let's document these steps and get a lab out there with a Spring Boot App and Edge Microgateway as a coresident.

For more folks interested in Apigee + PCF. We're looking for folks interested in trying a new set of labs. Please respond to this message to send you the directions.