{"id":37123449,"url":"https://github.com/axway/ace-golang-sdk","last_synced_at":"2026-01-14T14:15:19.641Z","repository":{"id":80263765,"uuid":"167935723","full_name":"Axway/ace-golang-sdk","owner":"Axway","description":"ECDGS-14676","archived":false,"fork":false,"pushed_at":"2019-08-16T20:11:03.000Z","size":98,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-06-20T02:06:10.185Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Axway.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-28T09:36:06.000Z","updated_at":"2019-08-14T16:09:13.000Z","dependencies_parsed_at":"2024-05-12T19:31:56.412Z","dependency_job_id":null,"html_url":"https://github.com/Axway/ace-golang-sdk","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Axway/ace-golang-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Axway%2Face-golang-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Axway%2Face-golang-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Axway%2Face-golang-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Axway%2Face-golang-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Axway","download_url":"https://codeload.github.com/Axway/ace-golang-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Axway%2Face-golang-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28422442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T14:15:18.914Z","updated_at":"2026-01-14T14:15:19.630Z","avatar_url":"https://github.com/Axway.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nACE SDK allows developers to implement microservices that can be used as executable step in a choreography.\n\n# Service Implemenation and Using the SDK\n\n## Implement the callback method\n\n### The callback method signature\n\nImplement the callback method that will process the received message. Below is the signature of the method\n\n```\nfunc businessMessageProcessor(executionContext linker.ExecutionContext) error\n```\n\n### Execution Context\n\nGet the Open Tracing Span Context\n\n```\nctx := executionContext.GetSpanContext();\n```\n\nGet the Business Message list\n\n```\nbusinessMsgs := executionContext.GetBusinessMessages();\n```\n\nGet the Message Producer Function\n\n```\nmsgProducer := executionContext.GetMsgProducer();\n```\n\nGet a String Config Value\n\n```\nstringParamNameValue := executionContext.GetStringConfigValue(\"stringParamName\");\n```\n\nGet an Int Config Value\n\n```\nintParamNameValue := executionContext.GetIntConfigValue(\"intParamName\");\n```\n\nGet a Boolean Config Value\n\n```\nboolParamNameValue := executionContext.GetBooleanConfigValue(\"boolParamName\");\n```\n\n### Input processing\n\nThe businessMsgs is an array of type messaging.BusinessMessage. Each identify a business message and holds the payload and the metadata associated with the payload.\n\n#### Processing payload\n\nThe payload can be retrieived using the interface method GetPayload() on businessMsg object.\n\nThe payload [type messaging.Payload] can be actual payload (use messaging.Payload.GetBody() to retrieve the content) or a reference to a location (use messaging.Payload.GetLocationReference() to identify if the payload body is location reference)\n\n#### Processing metadata\n\nThe metadata can be retrieved using the interface method GetMetaData() on businessMsg object which returns map of string key/value pairs identifying the metadata associated with the payload.\n\n### Output processing\n\nThe output of the processing can be responded by generating new message(s). To create a new message construct business message and setup metadata. The new message can then be produced using clientRelay parameter.\n\n#### Creating new ACE business message\n\n-   Construct the metadata\n\n    Constructing the metadata is done by setting up a map of string key/value pairs\n\n-   Contruct the payload\n\n    Create the payload with content as demonstrated below. The newContent in the example below is a byte array holding the raw content\n\n    ```\n    newPayload := messaging.Payload{Body: newContent}\n    ```\n\n    OR\n\n    Create the payload with location reference as demonstrated below. The newContent in the example below is a byte array holding the the location reference.\n\n    ```\n    newPayload := messaging.Payload{Body: newContent, LocationReference: true}\n    ```\n\n-   Construct the ACE business message\n\n    Create new business message object as demonstrated below. The \"newMetadata\" and \"newPayload\" in the example below identifies the metadata and payload for the new business message\n\n    ```\n    newBusinessMsg := messaging.BusinessMessage{ MetaData: newMetadata, Payload: \u0026newPayload}\n    ```\n\n#### Producing message\n\nTo produce messages use the Send method on msgProducer parameter as demostrated below\n\n```\nmsgProducer.Send(\u0026newBusinessMsg)\n```\n\n## Add trace for service execution (Optional)\n\nACE SDK has instrumentation for OpenTracing(https://opentracing.io/specification/) built-in and provides ability to allow the business service to inject the tracing spans.\n\nTo start a span as child of span managed by ACE, use StartSpanFromContext method from opentracing package. Using the created span the business service can log details as demonstrated below.\n\n```\nspan, ctxWithSpan := opentracing.StartSpanFromContext(ctx, \"business-service\")\nspan.LogFields(opentractingLog.String(\"event\", \"processed message\"))\nspan.Finish()\n```\n\n## Add log lines (Optional)\n\nACE SDK sets up a log object that can be used by the service to add additional logging to the console. Using the provided logger will write the lines consistent with the ACE SDK.\n\nA call to the log method and level will include a message and additional fields provided with zap logger calls. The SDK provides field names that may be used.\n\n```\nimport \"github.com/Axway/ace-golang-sdk/util/logging\"\nvar log = logging.Logger()\n\nlog.Debug(\"Business service config\",\n    zap.String(logging.LogFieldServiceName, cfg.ServiceName),\n    zap.String(logging.LogFieldServiceVersion, cfg.ServiceVersion),\n    zap.String(logging.LogFieldServiceType, cfg.ServiceType),\n    zap.String(logging.LogFieldServiceDesc, cfg.ServiceDescription),\n)\n```\n\n## Handling errors in the service execution\n\nACE SDK had three error types defined.\n\nSendingError - Can be returned from calling send method on the MsgProducer.\n\n```\nerror := msgProducer.Send(\u0026newBusinessMsg)\n```\n\nProcessingError - Returned by the BusinessMessageProcessor.\n\n```\nreturn linker.NewProcessingError(fmt.Errorf(\"processing error)\"))\n```\n\nSystemError - Returned by the BusinessMessageProcessor to clientRelay.\n\n```\nreturn linker.NewSystemError(fmt.Errorf(\"system error)\"))\n```\n\n## Register the service callback method with ACE\n\nACE business service must register the service info and callback method for making it usable as a step to build choreographies\nThe service registration needs following details\n\n-   Service Name\n-   Service Version\n-   Service Type\n    -   NATIVE\n    -   AGGREGATION\n-   Service Description\n-   Callback method\n\nThe business service may also define config parameters to be used when using the service in a choreography. These\nparameters need to be added prior to registering the callback method\n\n```\n# String Parmeters (name, default value, isRequired)\nAddStringConfigParam(\"parameterName\", \"defaultValue\", true)\n\n# Integer Parmeters (name, default value, isRequired)\nAddIntConfigParam(\"parameterName\", 123, false)\n\n# Boolean Parmeters (name, default value)\nAddBooleanConfigParam(\"parameterName\", false)\n```\n\nBelow is an example of Registering the service info \u0026 callback method and then starting the ACE processing\n\n```\naceAgent, err := linker.Register(serviceName, serviceVersion, serviceDescription, serviceType, businessMessageProcessor)\n\naceAgent.Start()\n```\n\nThe provided template reads the serviceName, serviceVersion and serviceDescription from following environment variables respectively, but its the implemenation choice on how to setup these details.\n\n-   SERVICE_NAME\n-   SERVICE_VERSION\n-   SERVICE_DESCRIPTION\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxway%2Face-golang-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxway%2Face-golang-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxway%2Face-golang-sdk/lists"}