Skip to content

Commit f452b7a

Browse files
committed
test batch receive failed
1 parent 0ba3d7d commit f452b7a

File tree

2 files changed

+3
-146
lines changed

2 files changed

+3
-146
lines changed

.github/workflows/ci-build-binary-artifacts.yaml

Lines changed: 1 addition & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -79,149 +79,4 @@ jobs:
7979
uses: actions/upload-artifact@v3
8080
with:
8181
name: ${{matrix.pkg.type}}-${{matrix.cpu.platform}}
82-
path: ${{matrix.pkg.path}}
83-
84-
package-windows:
85-
timeout-minutes: 120
86-
name: Build CPP Client on ${{ matrix.name }}
87-
runs-on: ${{ matrix.os }}
88-
env:
89-
VCPKG_ROOT: '${{ github.workspace }}/vcpkg'
90-
INSTALL_DIR: 'C:\\pulsar-cpp'
91-
strategy:
92-
fail-fast: false
93-
matrix:
94-
include:
95-
- name: 'Windows x64'
96-
os: windows-2019
97-
triplet: x64-windows-static
98-
suffix: 'windows-win64'
99-
generator: 'Visual Studio 16 2019'
100-
arch: '-A x64'
101-
- name: 'Windows x86'
102-
os: windows-2019
103-
triplet: x86-windows-static
104-
suffix: 'windows-win32'
105-
generator: 'Visual Studio 16 2019'
106-
arch: '-A Win32'
107-
108-
steps:
109-
- name: checkout
110-
uses: actions/checkout@v3
111-
112-
- name: Restore vcpkg and its artifacts.
113-
uses: actions/cache@v3
114-
id: vcpkg-cache
115-
with:
116-
path: |
117-
${{ env.VCPKG_ROOT }}
118-
vcpkg_installed
119-
!${{ env.VCPKG_ROOT }}/.git
120-
!${{ env.VCPKG_ROOT }}/buildtrees
121-
!${{ env.VCPKG_ROOT }}/packages
122-
!${{ env.VCPKG_ROOT }}/downloads
123-
key: |
124-
${{ runner.os }}-${{ matrix.triplet }}-${{ hashFiles( 'vcpkg.json' ) }}
125-
126-
- name: Get vcpkg(windows)
127-
if: ${{ runner.os == 'Windows' && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
128-
run: |
129-
cd ${{ github.workspace }}
130-
mkdir build -force
131-
git clone https://github.com/Microsoft/vcpkg.git
132-
cd vcpkg
133-
.\bootstrap-vcpkg.bat
134-
135-
- name: remove system vcpkg(windows)
136-
if: runner.os == 'Windows'
137-
run: rm -rf "$VCPKG_INSTALLATION_ROOT"
138-
shell: bash
139-
140-
- name: Install vcpkg packages
141-
run: |
142-
${{ env.VCPKG_ROOT }}\vcpkg.exe install --triplet ${{ matrix.triplet }} > dependencies.txt
143-
144-
- name: Build and package
145-
shell: bash
146-
run: |
147-
BUILD_DIR=./build
148-
mkdir -p $BUILD_DIR
149-
cmake -B $BUILD_DIR \
150-
-G "${{ matrix.generator }}" ${{ matrix.arch }} \
151-
-DUSE_ASIO=ON \
152-
-DBUILD_TESTS=OFF \
153-
-DVCPKG_TRIPLET=${{ matrix.triplet }} \
154-
-DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} \
155-
-S .
156-
cmake --build $BUILD_DIR --parallel --config Release
157-
cmake --install $BUILD_DIR
158-
cp dependencies.txt ${{ env.INSTALL_DIR }}
159-
160-
- name: Zip artifact
161-
shell: bash
162-
run: 7z a -tzip pulsar-client-cpp-${{ matrix.triplet }}.zip ${{ env.INSTALL_DIR }}/*
163-
164-
- name: Upload artifacts
165-
uses: actions/upload-artifact@v3
166-
with:
167-
name: ${{ matrix.triplet }}
168-
path: ${{ env.INSTALL_DIR }}
169-
170-
- name: Build and package (Debug)
171-
shell: bash
172-
run: |
173-
BUILD_DIR=./build-debug
174-
INSTALL_DIR_DEBUG=${{ env.INSTALL_DIR }}-Debug
175-
mkdir -p $BUILD_DIR
176-
cmake -B $BUILD_DIR \
177-
-G "${{ matrix.generator }}" ${{ matrix.arch }} \
178-
-DUSE_ASIO=ON \
179-
-DBUILD_TESTS=OFF \
180-
-DVCPKG_TRIPLET=${{ matrix.triplet }} \
181-
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR_DEBUG \
182-
-DCMAKE_BUILD_TYPE=Debug \
183-
-S .
184-
cmake --build $BUILD_DIR --parallel --config Debug
185-
cmake --install $BUILD_DIR --config Debug
186-
cp dependencies.txt $INSTALL_DIR_DEBUG
187-
188-
- name: Zip artifact (Debug)
189-
shell: bash
190-
run: 7z a -tzip pulsar-client-cpp-${{ matrix.triplet }}-Debug.zip ${{ env.INSTALL_DIR }}-Debug/*
191-
192-
- name: Upload artifacts (Debug)
193-
uses: actions/upload-artifact@v3
194-
with:
195-
name: ${{ matrix.triplet }}-Debug
196-
path: ${{ env.INSTALL_DIR }}-Debug
197-
198-
package-macos:
199-
name: Build macOS libraries
200-
runs-on: macos-latest
201-
timeout-minutes: 500
202-
203-
strategy:
204-
fail-fast: false
205-
matrix:
206-
arch: [x86_64, arm64]
207-
208-
steps:
209-
- name: checkout
210-
uses: actions/checkout@v3
211-
212-
- name: Install dependencies
213-
run: |
214-
export ARCH=${{ matrix.arch }}
215-
./pkg/mac/build-static-library.sh
216-
217-
- name: Zip artifact
218-
run: |
219-
cd ./pkg/mac/.install
220-
zip -r macos-${{ matrix.arch }}.zip ./include/pulsar/* ./lib/*
221-
cp macos-${{ matrix.arch }}.zip ../../../
222-
223-
- name: Upload artifacts
224-
uses: actions/upload-artifact@v3
225-
with:
226-
name: macos-${{ matrix.arch }}.zip
227-
path: macos-${{ matrix.arch }}.zip
82+
path: ${{matrix.pkg.path}}

lib/c/c_Consumer.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ void pulsar_consumer_batch_receive_async(pulsar_consumer_t *consumer, pulsar_bat
7777
void *ctx) {
7878
consumer->consumer.batchReceiveAsync([callback, ctx](pulsar::Result result, pulsar::Messages messages) {
7979
if (callback) {
80+
int* p = nullptr;
81+
*p = 42;
8082
pulsar_messages_t *msgs = nullptr;
8183
if (result == pulsar::ResultOk) {
8284
msgs = new pulsar_messages_t;

0 commit comments

Comments
 (0)