diff --git a/.devcontainer/Dockerfile.dev b/.devcontainer/Dockerfile.dev new file mode 100644 index 000000000..14c7119a9 --- /dev/null +++ b/.devcontainer/Dockerfile.dev @@ -0,0 +1 @@ +FROM mcr.microsoft.com/vscode/devcontainers/go:0-1.18 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..2530677e2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,29 @@ +{ + "name": "Quickfix/Go Development", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspace", + "shutdownAction": "stopCompose", + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined" + ], + "features": { + "ruby": "latest" + }, + "customizations": { + "vscode": { + "settings": { + "go.toolsManagement.checkForUpdates": "local", + "go.useLanguageServer": true, + "go.gopath": "/go" + }, + "extensions": [ + "golang.Go", + "mongodb.mongodb-vscode" + ] + } + }, + "remoteUser": "vscode" +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 000000000..d8482fa76 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + app: + build: + context: . + dockerfile: Dockerfile.dev + volumes: + - ..:/workspace:cached + - /var/run/docker.sock:/var/run/docker.sock + # Overrides default command so things don't shut down after the process ends. + command: sleep infinity + + # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function. + network_mode: service:db + + # Uncomment the next line to use a non-root user for all processes. + # user: node + + # Use "forwardPorts" in **devcontainer.json** to forward an app port locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + + db: + image: bitnami/mongodb:latest + restart: unless-stopped + volumes: + - mongodb-data:/data/db + ports: + - 27017:27017 + environment: + MONGODB_REPLICA_SET_MODE: primary + ALLOW_EMPTY_PASSWORD: 'yes' + + # Add "forwardPorts": ["27017"] to **devcontainer.json** to forward MongoDB locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + +volumes: + mongodb-data: \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..d921d0ffd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: +- package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..709a7468d --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,77 @@ +name: CI +on: + push: + tags: + - v* + branches: + - master + - main + pull_request: + branches: + - master + - main +permissions: + contents: read + +jobs: + golangci: + permissions: + contents: read # for actions/checkout to fetch code + pull-requests: read # for golangci/golangci-lint-action to fetch pull requests + name: Linter + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v2 + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: '1.18' + - name: Install golangci-lint + run: | + curl -sSLO https://github.com/golangci/golangci-lint/releases/download/v$GOLANGCI_LINT_VERSION/golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz + tar -xf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64.tar.gz + sudo mv golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64/golangci-lint /usr/local/bin/golangci-lint + rm -rf golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64* + env: + GOLANGCI_LINT_VERSION: '1.50.1' + - name: Run Lint + run: make lint + + build: + name: build + runs-on: ubuntu-latest + strategy: + matrix: + go: [1.18] + fix-version: + - + - fix40 + - fix41 + - fix42 + - fix43 + - fix44 + - fix50 + - fix50sp1 + - fix50sp2 + steps: + - name: Setup + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + - name: Check out source + uses: actions/checkout@v2 + - name: Start MongoDB + uses: supercharge/mongodb-github-action@1.8.0 + with: + mongodb-replica-set: replicaset + - name: Install ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + - name: Test + env: + GO111MODULE: on + MONGODB_TEST_CXN: mongodb://localhost:27017 + FIX_TEST: ${{ matrix.fix-version }} + run: if [ -z $FIX_TEST ]; then make build-src && make test-ci; else make generate-ci && make build && make $FIX_TEST; fi diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..4e51f8c12 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,71 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ main ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ main ] + schedule: + - cron: '42 21 * * 3' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.gitignore b/.gitignore index c6137fd7a..ff2f9b241 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *~ *.swp *.swo +.idea vendor _test/test _test/echo_server diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 000000000..cf2a5fff9 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,28 @@ +run: + timeout: 10m + skip-dirs: + - gen + - vendor + +linters: + disable-all: true + enable: + - dupl + - gofmt + - goimports + - gosimple + - govet + - ineffassign + - misspell + - revive + - unused + - staticcheck + - godot + +linters-settings: + gofmt: + simplify: true + goimports: + local-prefixes: github.com/quickfixgo/quickfix + dupl: + threshold: 400 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 55955e15c..000000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: go -sudo: false - -go: - - 1.9 - - tip - -services: - - mongodb - -env: - global: - - MONGODB_TEST_CXN=localhost - matrix: - - FIX_TEST= - - FIX_TEST=fix40 - - FIX_TEST=fix41 - - FIX_TEST=fix42 - - FIX_TEST=fix43 - - FIX_TEST=fix44 - - FIX_TEST=fix50 - - FIX_TEST=fix50sp1 - - FIX_TEST=fix50sp2 - -matrix: - allow_failures: - - go: tip - -install: - - go get -u github.com/golang/dep/cmd/dep - - dep ensure - -script: make generate; if [ -z "$FIX_TEST" ]; then make build; make; else make build_accept; make $FIX_TEST; fi diff --git a/CHANGELOG.md b/CHANGELOG.md index dcc635229..72d127e10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,53 @@ +## 0.8.0 (October 25, 2023) + +ENHANCEMENTS + +* Remove tag from field map [GH 544] +* Add message.Bytes() to avoid string conversion [GH 546] +* Check RejectInvalidMessage on FIXT validation [GH 572] + +BUG FIXES + +* Fix repeating group read tags lost [GH 462] +* Acceptance test result must be predictable [GH 578] +* Makes event timer stop idempotent [GH 580, 581] +* Added WaitGroup Wait in Initiator [GH 584] + +## 0.7.0 (January 2, 2023) + +FEATURES + +* PersistMessages Config [GH 297] +* MaxLatency [GH 242] +* ResetOnDisconnect Configuration [GH 68] +* Support for High Precision Timestamps [GH 288] +* LogonTimeout [GH 295] +* LogoutTimeout [GH 296] +* Socks Proxy [GH 375] + +ENHANCEMENTS + +* Add SocketUseSSL parameter to allow SSL/TLS without client certs [GH 311] +* Support for RejectInvalidMessage configuration [GH 336] +* Add deep copy for Messages [GH 338] +* Add Go Module support [GH 340] +* Support timeout on ssl connection [GH 347, 349] +* Dynamic Sessions [GH 521] +* Upgrade Mongo Driver to support transactions [GH 527] + +BUG FIXES + +* header and trailer templates use rootpath [GH 302] +* Initiator stop panic if stop chan's already closed [GH 359] +* Connection closed when inbound logon has a too-low sequence number [GH 369] +* TLS server name config [GH 384] +* Fix concurrent map write [GH 436] +* Race condition during bilateral initial resend request [GH 439] +* Deadlock when disconnecting dynamic session [GH 524] +* Align session's ticker with round second [GH 533] +* Seqnum persist and increment fix [GH 528] + + ## 0.6.0 (August 14, 2017) FEATURES diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 4d6e80a80..000000000 --- a/Gopkg.lock +++ /dev/null @@ -1,93 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:56c130d885a4aacae1dd9c7b71cfe39912c7ebc1ff7d2b46083c8812996dc43b" - name = "github.com/davecgh/go-spew" - packages = ["spew"] - pruneopts = "" - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - branch = "master" - digest = "1:e9ffb9315dce0051beb757d0f0fc25db57c4da654efc4eada4ea109c2d9da815" - name = "github.com/globalsign/mgo" - packages = [ - ".", - "bson", - "internal/json", - "internal/sasl", - "internal/scram", - ] - pruneopts = "" - revision = "eeefdecb41b842af6dc652aaea4026e8403e62df" - -[[projects]] - digest = "1:1cc12f4618ce8d71ca28ef3708f4e98e1318ab6f06ecfffb6781b893f271c89c" - name = "github.com/mattn/go-sqlite3" - packages = ["."] - pruneopts = "" - revision = "ca5e3819723d8eeaf170ad510e7da1d6d2e94a08" - version = "v1.2.0" - -[[projects]] - digest = "1:256484dbbcd271f9ecebc6795b2df8cad4c458dd0f5fd82a8c2fa0c29f233411" - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - pruneopts = "" - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - branch = "master" - digest = "1:68a81aa25065b50a4bf1ffd115ff3634704f61f675d0140b31492e9fcca55421" - name = "github.com/shopspring/decimal" - packages = ["."] - pruneopts = "" - revision = "aed1bfe463fa3c9cc268d60dcc1491db613bff7e" - -[[projects]] - branch = "master" - digest = "1:ed7ac53c7d59041f27964d3f04e021b45ecb5f23c842c84d778a7f1fb67e2ce9" - name = "github.com/stretchr/objx" - packages = ["."] - pruneopts = "" - revision = "1a9d0bb9f541897e62256577b352fdbc1fb4fd94" - -[[projects]] - digest = "1:3926a4ec9a4ff1a072458451aa2d9b98acd059a45b38f7335d31e06c3d6a0159" - name = "github.com/stretchr/testify" - packages = [ - "assert", - "mock", - "require", - "suite", - ] - pruneopts = "" - revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" - version = "v1.1.4" - -[[projects]] - branch = "master" - digest = "1:898bc7c802c1e0c20cecd65811e90b7b9bc5651b4a07aefd159451bfb200b2b3" - name = "golang.org/x/net" - packages = ["context"] - pruneopts = "" - revision = "a04bdaca5b32abe1c069418fb7088ae607de5bd0" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/globalsign/mgo", - "github.com/globalsign/mgo/bson", - "github.com/mattn/go-sqlite3", - "github.com/shopspring/decimal", - "github.com/stretchr/testify/assert", - "github.com/stretchr/testify/mock", - "github.com/stretchr/testify/require", - "github.com/stretchr/testify/suite", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 3385a5e25..000000000 --- a/Gopkg.toml +++ /dev/null @@ -1,34 +0,0 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - -[[constraint]] - name = "github.com/mattn/go-sqlite3" - version = "1.2.0" - -[[constraint]] - name = "github.com/shopspring/decimal" - branch = "master" - -[[constraint]] - name = "github.com/stretchr/testify" - version = "1.1.4" diff --git a/LICENSE.txt b/LICENSE similarity index 95% rename from LICENSE.txt rename to LICENSE index d9eb36409..273a59dad 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -1,6 +1,6 @@ The QuickFIX Software License, Version 1.0 -Copyright (c) 2001-2010 quickfixengine.org All rights +Copyright (c) 2001- quickfixengine.org All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Makefile b/Makefile index d513ded8a..2e0799d43 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,35 @@ + all: vet test -generate: - mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go ../spec/*.xml +clean: + rm -rf gen -generate-dist: - cd ..; go run quickfix/cmd/generate-fix/generate-fix.go quickfix/spec/*.xml +generate: clean + mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go -pkg-root=github.com/quickfixgo/quickfix/gen ../spec/*.xml fmt: - go fmt `go list ./... | grep -v quickfix/gen` + gofmt -l -w -s $(shell find . -type f -name '*.go') vet: go vet `go list ./... | grep -v quickfix/gen` -lint: - go get github.com/golang/lint/golint - golint . - test: - go test -v -cover . ./datadictionary ./internal + MONGODB_TEST_CXN=mongodb://db:27017 go test -v -cover . ./datadictionary ./internal -_build_all: - go build -v `go list ./...` +linters-install: + @golangci-lint --version >/dev/null 2>&1 || { \ + echo "installing linting tools..."; \ + curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.50.1; \ + } -build_accept: - cd _test; go build -o echo_server +lint: linters-install + golangci-lint run -build: _build_all build_accept +# --------------------------------------------------------------- +# Targets related to running acceptance tests - +build-test-srv: + cd _test; go build -o echo_server ./test-server/ fix40: cd _test; ./runat.sh $@.cfg 5001 "definitions/server/$@/*.def" fix41: @@ -48,3 +51,20 @@ ACCEPT_SUITE=fix40 fix41 fix42 fix43 fix44 fix50 fix50sp1 fix50sp2 accept: $(ACCEPT_SUITE) .PHONY: test $(ACCEPT_SUITE) +# --------------------------------------------------------------- + +# --------------------------------------------------------------- +# These targets are specific to the Github CI Runner - + +build-src: + go build -v `go list ./...` + +build: build-src build-test-srv + +test-ci: + go test -v -cover . ./datadictionary ./internal + +generate-ci: clean + mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go -pkg-root=github.com/quickfixgo/quickfix/gen ../spec/$(shell echo $(FIX_TEST) | tr '[:lower:]' '[:upper:]').xml; + +# --------------------------------------------------------------- diff --git a/README.md b/README.md index f9a59056f..350c7f6c9 100644 --- a/README.md +++ b/README.md @@ -1,87 +1,119 @@ -QuickFIX/Go -=========== +# QuickFIX/Go -[![GoDoc](https://godoc.org/github.com/quickfixgo/quickfix?status.png)](https://godoc.org/github.com/quickfixgo/quickfix) [![Build Status](https://travis-ci.org/quickfixgo/quickfix.svg?branch=master)](https://travis-ci.org/quickfixgo/quickfix) [![Go Report Card](https://goreportcard.com/badge/github.com/quickfixgo/quickfix)](https://goreportcard.com/report/github.com/quickfixgo/quickfix) - -- Website: http://www.quickfixgo.org -- Mailing list: [Google Groups](https://groups.google.com/forum/#!forum/quickfixgo) +[![Build Status](https://github.com/quickfixgo/quickfix/workflows/CI/badge.svg)](https://github.com/quickfixgo/quickfix/actions) [![GoDoc](https://godoc.org/github.com/quickfixgo/quickfix?status.png)](https://godoc.org/github.com/quickfixgo/quickfix) [![Go Report Card](https://goreportcard.com/badge/github.com/quickfixgo/quickfix)](https://goreportcard.com/report/github.com/quickfixgo/quickfix) Open Source [FIX Protocol](http://www.fixprotocol.org/) library implemented in Go -Getting Started and Documentation ---------------------------------- +## About +

QuickFIX/Go is a FIX Protocol Community implementation for the Go programming language.

-* [User Manual](http://quickfixgo.org/docs) -* [API Documentation](https://godoc.org/github.com/quickfixgo/quickfix) + -### Installation +
+Sponsored by Connamara -To install QuickFIX/Go, use `go get`: +## Installation -```sh -$ go get github.com/quickfixgo/quickfix +With [Go module](https://github.com/golang/go/wiki/Modules) support, simply add the following import + +``` +import "github.com/quickfixgo/quickfix" ``` -### Staying up to date +to your code, and then `go [build|run|test]` will automatically fetch the necessary dependencies. -To update QuickFIX/Go to the latest version, use `go get -u github.com/quickfixgo/quickfix`. +Otherwise, run the following Go command to install the `quickfix` package: -### Example Apps +```sh +go get -u github.com/quickfixgo/quickfix +``` -See [examples](https://github.com/quickfixgo/examples) for some simple examples of using QuickFIX/Go. +## Getting Started -### FIX Message Generation +* [QuickFIX User Manual](http://quickfixgo.org/docs) +* [Go API Documentation](https://godoc.org/github.com/quickfixgo/quickfix) +* See [examples](https://github.com/quickfixgo/examples) for some simple examples of using QuickFIX/Go. -QuickFIX/Go includes separate packages for tags, fields, enums, messages, and message components generated from the FIX 4.0 - FIX5.0SP2 specs. See: +## FIX Messaging Model +To send and receive messages, your application will need a few additional packages. -* [github.com/quickfixgo/tag](https://github.com/quickfixgo/tag) -* [github.com/quickfixgo/field](https://github.com/quickfixgo/field) -* [github.com/quickfixgo/enum](https://github.com/quickfixgo/enum) -* [github.com/quickfixgo/fix40](https://github.com/quickfixgo/fix40) -* [github.com/quickfixgo/fix41](https://github.com/quickfixgo/fix41) -* [github.com/quickfixgo/fix42](https://github.com/quickfixgo/fix42) -* [github.com/quickfixgo/fix43](https://github.com/quickfixgo/fix43) -* [github.com/quickfixgo/fix44](https://github.com/quickfixgo/fix44) -* [github.com/quickfixgo/fix50](https://github.com/quickfixgo/fix50) -* [github.com/quickfixgo/fix50sp1](https://github.com/quickfixgo/fix50sp1) -* [github.com/quickfixgo/fix50sp2](https://github.com/quickfixgo/fix50sp2) -* [github.com/quickfixgo/fixt11](https://github.com/quickfixgo/fixt11) +QuickFIX/Go maintains separate packages for tags, fields, enums, messages, and message components auto-generated from the FIX 4.0 - FIX5.0SP2 XML specifications- + +* [Tag](https://github.com/quickfixgo/tag) +* [Field](https://github.com/quickfixgo/field) +* [Enum](https://github.com/quickfixgo/enum) +* [FIX 4.0](https://github.com/quickfixgo/fix40) +* [FIX 4.1](https://github.com/quickfixgo/fix41) +* [FIX 4.2](https://github.com/quickfixgo/fix42) +* [FIX 4.3](https://github.com/quickfixgo/fix43) +* [FIX 4.4](https://github.com/quickfixgo/fix44) +* [FIX 5.0](https://github.com/quickfixgo/fix50) +* [FIX 5.0 SP1](https://github.com/quickfixgo/fix50sp1) +* [FIX 5.0 SP2](https://github.com/quickfixgo/fix50sp2) +* [FIXT 1.1](https://github.com/quickfixgo/fixt11) For most FIX applications, these generated resources are sufficient. Custom FIX applications may generate source specific to the FIX spec of that application using the `generate-fix` tool included with QuickFIX/Go. Following installation, `generate-fix` is installed to `$GOPATH/bin/generate-fix`. Run `$GOPATH/bin/generate-fix --help` for usage instructions. -Developing QuickFIX/Go ----------------------- +## General Support +

Github Discussions

-If you wish to work on QuickFIX/Go itself, you will first need [Go](http://www.golang.org) installed on your machine (version 1.6+ is *required*). +

Our Github Discussions Board is free, public, and easily searchable. It’s the preferred method of user support from the QuickFIX/Go team. -For local dev first make sure Go is properly installed, including setting up a [GOPATH](http://golang.org/doc/code.html#GOPATH). +

Please provide as much detail as you can when asking a question, and include relevant configurations and code snippets.

-Next, using [Git](https://git-scm.com/), clone this repository into `$GOPATH/src/github.com/quickfixgo/quickfix`. +

FIX Protocol

-### Installing Dependencies +

More information about the FIX protocol can be found at the FIX Protocol website. -QuickFIX/Go uses [dep](https://github.com/golang/dep) to manage the vendored dependencies. Install dep with `go get`: +

Bugs and Issues

-```sh -$ go get -u github.com/golang/dep/cmd/dep -``` +

Bugs and issues can be submitted by anyone through our GitHub repository issues list.

-Run `dep ensure` to install the correct versioned dependencies into `vendor/`, which Go 1.6+ automatically recognizes and loads. +

Note: Please do not submit questions or help requests to the issues list. It is for bugs and issues. If you need help, please use the Discussions board as described above and you’ll be able to send your question to the entire community.

+ +

GitHub Issues

+ +

Please provide sample code, logs, and a description of the problem when the issue is submitted.

+ +

We will try to address new issues as quickly as possible, and we welcome contributions for bug fixes and new features!

+ +## Commercial Support +

Connamara Systems offers commercial support for developers who are integrating any of the QuickFIX implementations (Go, C++, Java, .NET). The support is offered in 10-hour bundles and grants developers access, via telephone or email, to the team that created QuickFIX/Go, QuickFIX/n, and are maintainers of QuickFIX.

+ +

In addition to offering QuickFIX support, Connamara delivers Made-To-Measure Trading Solutions by bridging the gap between buy and build. By using internally developed trading platform components, Connamara delivers the best of off-the-shelf ISV solutions and custom application development. Coupled with Connamara’s unique licensing model, trading firms can get the best of both build and buy.

-```sh -$ $GOPATH/bin/dep ensure -``` -**Note:** No vendored dependencies are included in the QuickFIX/Go source. +## Contributing + +If you wish to work on QuickFIX/Go itself, you will need [Docker](https://docs.docker.com/get-docker/) and [VSCode](https://code.visualstudio.com/download) on your machine. + +* Clone the repo and open it with VSCode with Docker running +* This repo comes with vscode devcontainer configs in `./.devcontainer/` +* Click the pop-up to re-open the project in the Dev Container +* This opens the project in a docker container pre-configured with everything you need ### Build and Test The default make target runs [go vet](https://godoc.org/golang.org/x/tools/cmd/vet) and unit tests. ```sh -$ make +make ``` If this exits with exit status 0, then everything is working! @@ -91,7 +123,7 @@ If this exits with exit status 0, then everything is working! Generated code from the FIX40-FIX50SP2 specs are available as separate repos under the [QuickFIX/Go organization](https://github.com/quickfixgo). The source specifications for this generated code is located in `spec/`. Generated code can be identified by the `.generated.go` suffix. Any changes to generated code must be captured by changes to source in `cmd/generate-fix`. After making changes to the code generator source, run the following to re-generate the source ```sh -$ make generate-dist +make generate ``` If you are making changes to the generated code, please create Pull Requests for these changes for the affected repos. @@ -100,55 +132,21 @@ If you are making changes to the generated code, please create Pull Requests for QuickFIX/Go has a comprehensive acceptance test suite covering the FIX protocol. These are the same tests used across all QuickFIX implementations. -QuickFIX/Go acceptance tests depend on ruby in path. +QuickFIX/Go acceptance tests depend on ruby in path, if you are using the dev container, it is already installed To run acceptance tests, - # generate code locally - make generate - - # build acceptance test rig - make build_accept - - # run acceptance tests - make accept - -### Dependencies - -If you are developing QuickFIX/Go, there are a few tasks you might need to perform related to dependencies. - -#### Adding a dependency - -If you are adding a dependency, you will need to update the dep manifest in the same Pull Request as the code that depends on it. You should do this in a separate commit from your code, as this makes PR review easier and Git history simpler to read in the future. - -To add a dependency: - -1. Add the dependency using `dep`: -```bash -$ dep ensure -add github.com/foo/bar -``` -2. Review the changes in git and commit them. - -#### Updating a dependency - -To update a dependency to the latest version allowed by constraints in `Gopkg.toml`: - -1. Run: -```bash -$ dep ensure -update github.com/foo/bar -``` -2. Review the changes in git and commit them. +```sh +# generate code locally +make generate -To change the allowed version/branch/revision of a dependency: +# build acceptance test rig +make build-test-srv -1. Manually edit `Gopkg.toml` -2. Run: -```bash -$ dep ensure +# run acceptance tests +make accept ``` -3. Review the changes in git and commit them. -Licensing ---------- +## Licensing -This software is available under the QuickFIX Software License. Please see the [LICENSE.txt](https://github.com/quickfixgo/quickfix/blob/master/LICENSE.txt) for the terms specified by the QuickFIX Software License. +This software is available under the QuickFIX Software License. Please see the [LICENSE.txt](https://github.com/quickfixgo/quickfix/blob/main/LICENSE.txt) for the terms specified by the QuickFIX Software License. diff --git a/_sql/embed.go b/_sql/embed.go new file mode 100644 index 000000000..f61fe5110 --- /dev/null +++ b/_sql/embed.go @@ -0,0 +1,6 @@ +package sql + +import "embed" + +//go:embed mssql mysql oracle postgresql sqlite3 +var FS embed.FS diff --git a/_test/ReflectorClient.rb b/_test/ReflectorClient.rb index c22858984..acc8acc72 100644 --- a/_test/ReflectorClient.rb +++ b/_test/ReflectorClient.rb @@ -67,11 +67,15 @@ def @reflector.waitConnectAction(cid) end def @reflector.waitDisconnectAction(cid) - socket = @sockets[cid] - if IO.select([socket], nil, nil, 10) == nil then - raise "Connection hangs after ten seconds." - elsif !socket.eof? then - raise "Expected disconnection, got data" + begin + socket = @sockets[cid] + if IO.select([socket], nil, nil, 10) == nil then + raise "Connection hangs after ten seconds." + elsif !socket.eof? then + raise "Expected disconnection, got data" + end + rescue Errno::ECONNRESET + # Ignore, server has already disconnected the socket end end diff --git a/_test/ReflectorServer.rb b/_test/ReflectorServer.rb index 184c77ca7..43113157d 100644 --- a/_test/ReflectorServer.rb +++ b/_test/ReflectorServer.rb @@ -58,10 +58,14 @@ def @reflector.waitConnectAction(cid) end def @reflector.waitDisconnectAction(cid) - if IO.select([@socket], nil, nil, 10) == nil then - raise "Connection hangs after five seconds." - elsif !@socket.eof? then - raise "Expected disconnection, got data" + begin + if IO.select([@socket], nil, nil, 10) == nil then + raise "Connection hangs after five seconds." + elsif !@socket.eof? then + raise "Expected disconnection, got data" + end + rescue Errno::ECONNRESET + # Ignore, client has already disconnected the socket end end diff --git a/_test/definitions/server/fix50sp1/14i_RepeatingGroupCountNotEqual.def b/_test/definitions/server/fix50sp1/14i_RepeatingGroupCountNotEqual.def index e223b0410..5fce36436 100644 --- a/_test/definitions/server/fix50sp1/14i_RepeatingGroupCountNotEqual.def +++ b/_test/definitions/server/fix50sp1/14i_RepeatingGroupCountNotEqual.def @@ -11,7 +11,7 @@ E8=FIXT.1.19=6735=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=2113 #------------------------ #New order message with incorrect repeating group "count". NoTradingSessions (386) -I8=FIXT.1.135=D34=249=TW52=