1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
/* automatically generated by rust-bindgen 0.55.1 */

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_string_list {
    _unused: [u8; 0],
}
pub type pulsar_string_list_t = _pulsar_string_list;
extern "C" {
    pub fn pulsar_string_list_create() -> *mut pulsar_string_list_t;
}
extern "C" {
    pub fn pulsar_string_list_free(list: *mut pulsar_string_list_t);
}
extern "C" {
    pub fn pulsar_string_list_size(list: *mut pulsar_string_list_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_string_list_append(
        list: *mut pulsar_string_list_t,
        item: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn pulsar_string_list_get(
        map: *mut pulsar_string_list_t,
        index: ::std::os::raw::c_int,
    ) -> *const ::std::os::raw::c_char;
}
pub const pulsar_result_pulsar_result_Ok: pulsar_result = 0;
#[doc = " Operation successful"]
pub const pulsar_result_pulsar_result_UnknownError: pulsar_result = 1;
#[doc = " Unknown error happened on broker"]
pub const pulsar_result_pulsar_result_InvalidConfiguration: pulsar_result = 2;
#[doc = " Invalid configuration"]
pub const pulsar_result_pulsar_result_Timeout: pulsar_result = 3;
#[doc = " Operation timed out"]
pub const pulsar_result_pulsar_result_LookupError: pulsar_result = 4;
#[doc = " Broker lookup failed"]
pub const pulsar_result_pulsar_result_ConnectError: pulsar_result = 5;
#[doc = " Failed to connect to broker"]
pub const pulsar_result_pulsar_result_ReadError: pulsar_result = 6;
#[doc = " Failed to read from socket"]
pub const pulsar_result_pulsar_result_AuthenticationError: pulsar_result = 7;
#[doc = " Authentication failed on broker"]
pub const pulsar_result_pulsar_result_AuthorizationError: pulsar_result = 8;
#[doc = " Client is not authorized to create producer/consumer"]
pub const pulsar_result_pulsar_result_ErrorGettingAuthenticationData: pulsar_result = 9;
#[doc = " Client cannot find authorization data"]
pub const pulsar_result_pulsar_result_BrokerMetadataError: pulsar_result = 10;
#[doc = " Broker failed in updating metadata"]
pub const pulsar_result_pulsar_result_BrokerPersistenceError: pulsar_result = 11;
#[doc = " Broker failed to persist entry"]
pub const pulsar_result_pulsar_result_ChecksumError: pulsar_result = 12;
#[doc = " Corrupt message checksum failure"]
pub const pulsar_result_pulsar_result_ConsumerBusy: pulsar_result = 13;
#[doc = " Exclusive consumer is already connected"]
pub const pulsar_result_pulsar_result_NotConnected: pulsar_result = 14;
#[doc = " Producer/Consumer is not currently connected to broker"]
pub const pulsar_result_pulsar_result_AlreadyClosed: pulsar_result = 15;
#[doc = " Producer/Consumer is already closed and not accepting any operation"]
pub const pulsar_result_pulsar_result_InvalidMessage: pulsar_result = 16;
#[doc = " Error in publishing an already used message"]
pub const pulsar_result_pulsar_result_ConsumerNotInitialized: pulsar_result = 17;
#[doc = " Consumer is not initialized"]
pub const pulsar_result_pulsar_result_ProducerNotInitialized: pulsar_result = 18;
#[doc = " Producer is not initialized"]
pub const pulsar_result_pulsar_result_TooManyLookupRequestException: pulsar_result = 19;
#[doc = " Too Many concurrent LookupRequest"]
pub const pulsar_result_pulsar_result_InvalidTopicName: pulsar_result = 20;
#[doc = " Invalid topic name"]
pub const pulsar_result_pulsar_result_InvalidUrl: pulsar_result = 21;
#[doc = " Client Initialized with Invalid Broker Url (VIP Url passed to Client"]
#[doc = " Constructor)"]
pub const pulsar_result_pulsar_result_ServiceUnitNotReady: pulsar_result = 22;
#[doc = " Service Unit unloaded between client did lookup and"]
#[doc = " producer/consumer got created"]
pub const pulsar_result_pulsar_result_OperationNotSupported: pulsar_result = 23;
#[doc = " Service Unit unloaded between client did lookup and"]
#[doc = " producer/consumer got created"]
pub const pulsar_result_pulsar_result_ProducerBlockedQuotaExceededError: pulsar_result = 24;
#[doc = " Producer is blocked"]
pub const pulsar_result_pulsar_result_ProducerBlockedQuotaExceededException: pulsar_result = 25;
#[doc = " Producer is getting exception"]
pub const pulsar_result_pulsar_result_ProducerQueueIsFull: pulsar_result = 26;
#[doc = " Producer queue is full"]
pub const pulsar_result_pulsar_result_MessageTooBig: pulsar_result = 27;
#[doc = " Trying to send a messages exceeding the max size"]
pub const pulsar_result_pulsar_result_TopicNotFound: pulsar_result = 28;
#[doc = " Topic not found"]
pub const pulsar_result_pulsar_result_SubscriptionNotFound: pulsar_result = 29;
#[doc = " Subscription not found"]
pub const pulsar_result_pulsar_result_ConsumerNotFound: pulsar_result = 30;
#[doc = " Consumer not found"]
pub const pulsar_result_pulsar_result_UnsupportedVersionError: pulsar_result = 31;
#[doc = " Error when an older client/version doesn't support a required"]
#[doc = " feature"]
pub const pulsar_result_pulsar_result_TopicTerminated: pulsar_result = 32;
#[doc = " Topic was already terminated"]
pub const pulsar_result_pulsar_result_CryptoError: pulsar_result = 33;
pub type pulsar_result = ::std::os::raw::c_int;
extern "C" {
    pub fn pulsar_result_str(result: pulsar_result) -> *const ::std::os::raw::c_char;
}
pub type size_t = ::std::os::raw::c_ulonglong;
pub type wchar_t = ::std::os::raw::c_ushort;
pub type max_align_t = f64;
pub type int_least64_t = i64;
pub type uint_least64_t = u64;
pub type int_fast64_t = i64;
pub type uint_fast64_t = u64;
pub type int_least32_t = i32;
pub type uint_least32_t = u32;
pub type int_fast32_t = i32;
pub type uint_fast32_t = u32;
pub type int_least16_t = i16;
pub type uint_least16_t = u16;
pub type int_fast16_t = i16;
pub type uint_fast16_t = u16;
pub type int_least8_t = i8;
pub type uint_least8_t = u8;
pub type int_fast8_t = i8;
pub type uint_fast8_t = u8;
pub type intmax_t = ::std::os::raw::c_longlong;
pub type uintmax_t = ::std::os::raw::c_ulonglong;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_string_map {
    _unused: [u8; 0],
}
pub type pulsar_string_map_t = _pulsar_string_map;
extern "C" {
    pub fn pulsar_string_map_create() -> *mut pulsar_string_map_t;
}
extern "C" {
    pub fn pulsar_string_map_free(map: *mut pulsar_string_map_t);
}
extern "C" {
    pub fn pulsar_string_map_size(map: *mut pulsar_string_map_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_string_map_put(
        map: *mut pulsar_string_map_t,
        key: *const ::std::os::raw::c_char,
        value: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn pulsar_string_map_get(
        map: *mut pulsar_string_map_t,
        key: *const ::std::os::raw::c_char,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_string_map_get_key(
        map: *mut pulsar_string_map_t,
        idx: ::std::os::raw::c_int,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_string_map_get_value(
        map: *mut pulsar_string_map_t,
        idx: ::std::os::raw::c_int,
    ) -> *const ::std::os::raw::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_message {
    _unused: [u8; 0],
}
pub type pulsar_message_t = _pulsar_message;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_message_id {
    _unused: [u8; 0],
}
pub type pulsar_message_id_t = _pulsar_message_id;
extern "C" {
    pub fn pulsar_message_create() -> *mut pulsar_message_t;
}
extern "C" {
    pub fn pulsar_message_free(message: *mut pulsar_message_t);
}
extern "C" {
    #[doc = " Builder"]
    pub fn pulsar_message_set_content(
        message: *mut pulsar_message_t,
        data: *const ::std::os::raw::c_void,
        size: size_t,
    );
}
extern "C" {
    #[doc = " Set content of the message to a buffer already allocated by the caller. No copies of"]
    #[doc = " this buffer will be made. The caller is responsible to ensure the memory buffer is"]
    #[doc = " valid until the message has been persisted (or an error is returned)."]
    pub fn pulsar_message_set_allocated_content(
        message: *mut pulsar_message_t,
        data: *mut ::std::os::raw::c_void,
        size: size_t,
    );
}
extern "C" {
    pub fn pulsar_message_set_property(
        message: *mut pulsar_message_t,
        name: *const ::std::os::raw::c_char,
        value: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    #[doc = " set partition key for the message routing"]
    #[doc = " @param hash of this key is used to determine message's topic partition"]
    pub fn pulsar_message_set_partition_key(
        message: *mut pulsar_message_t,
        partitionKey: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    #[doc = " Sets the ordering key of the message for message dispatch in Key_Shared mode."]
    #[doc = " @param the ordering key for the message"]
    pub fn pulsar_message_set_ordering_key(
        message: *mut pulsar_message_t,
        orderingKey: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    #[doc = " Set the event timestamp for the message."]
    pub fn pulsar_message_set_event_timestamp(message: *mut pulsar_message_t, eventTimestamp: u64);
}
extern "C" {
    #[doc = " Specify a custom sequence id for the message being published."]
    #[doc = " <p>"]
    #[doc = " The sequence id can be used for deduplication purposes and it needs to follow these rules:"]
    #[doc = " <ol>"]
    #[doc = " <li><code>sequenceId >= 0</code>"]
    #[doc = " <li>Sequence id for a message needs to be greater than sequence id for earlier messages:"]
    #[doc = " <code>sequenceId(N+1) > sequenceId(N)</code>"]
    #[doc = " <li>It's not necessary for sequence ids to be consecutive. There can be holes between messages. Eg. the"]
    #[doc = " <code>sequenceId</code> could represent an offset or a cumulative size."]
    #[doc = " </ol>"]
    #[doc = ""]
    #[doc = " @param sequenceId"]
    #[doc = "            the sequence id to assign to the current message"]
    pub fn pulsar_message_set_sequence_id(message: *mut pulsar_message_t, sequenceId: i64);
}
extern "C" {
    #[doc = " Specify a delay for the delivery of the messages."]
    #[doc = ""]
    #[doc = " @param delay the delay in milliseconds"]
    pub fn pulsar_message_set_deliver_after(message: *mut pulsar_message_t, delayMillis: u64);
}
extern "C" {
    #[doc = " Specify the this message should not be delivered earlier than the"]
    #[doc = " specified timestamp."]
    #[doc = ""]
    #[doc = " @param deliveryTimestamp UTC based timestamp in milliseconds"]
    pub fn pulsar_message_set_deliver_at(
        message: *mut pulsar_message_t,
        deliveryTimestampMillis: u64,
    );
}
extern "C" {
    #[doc = " override namespace replication clusters.  note that it is the"]
    #[doc = " caller's responsibility to provide valid cluster names, and that"]
    #[doc = " all clusters have been previously configured as topics."]
    #[doc = ""]
    #[doc = " given an empty list, the message will replicate per the namespace"]
    #[doc = " configuration."]
    #[doc = ""]
    #[doc = " @param clusters where to send this message."]
    pub fn pulsar_message_set_replication_clusters(
        message: *mut pulsar_message_t,
        clusters: *mut *const ::std::os::raw::c_char,
        size: size_t,
    );
}
extern "C" {
    #[doc = " Do not replicate this message"]
    #[doc = " @param flag if true, disable replication, otherwise use default"]
    #[doc = " replication"]
    pub fn pulsar_message_disable_replication(
        message: *mut pulsar_message_t,
        flag: ::std::os::raw::c_int,
    );
}
extern "C" {
    #[doc = " Return the properties attached to the message."]
    #[doc = " Properties are application defined key/value pairs that will be attached to the message"]
    #[doc = ""]
    #[doc = " @return an unmodifiable view of the properties map"]
    pub fn pulsar_message_get_properties(
        message: *mut pulsar_message_t,
    ) -> *mut pulsar_string_map_t;
}
extern "C" {
    #[doc = " Check whether the message has a specific property attached."]
    #[doc = ""]
    #[doc = " @param name the name of the property to check"]
    #[doc = " @return true if the message has the specified property"]
    #[doc = " @return false if the property is not defined"]
    pub fn pulsar_message_has_property(
        message: *mut pulsar_message_t,
        name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Get the value of a specific property"]
    #[doc = ""]
    #[doc = " @param name the name of the property"]
    #[doc = " @return the value of the property or null if the property was not defined"]
    pub fn pulsar_message_get_property(
        message: *mut pulsar_message_t,
        name: *const ::std::os::raw::c_char,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Get the content of the message"]
    #[doc = ""]
    #[doc = ""]
    #[doc = " @return the pointer to the message payload"]
    pub fn pulsar_message_get_data(message: *mut pulsar_message_t)
        -> *const ::std::os::raw::c_void;
}
extern "C" {
    #[doc = " Get the length of the message"]
    #[doc = ""]
    #[doc = " @return the length of the message payload"]
    pub fn pulsar_message_get_length(message: *mut pulsar_message_t) -> u32;
}
extern "C" {
    #[doc = " Get the unique message ID associated with this message."]
    #[doc = ""]
    #[doc = " The message id can be used to univocally refer to a message without having to keep the entire payload"]
    #[doc = " in memory."]
    #[doc = ""]
    #[doc = " Only messages received from the consumer will have a message id assigned."]
    #[doc = ""]
    pub fn pulsar_message_get_message_id(
        message: *mut pulsar_message_t,
    ) -> *mut pulsar_message_id_t;
}
extern "C" {
    #[doc = " Get the partition key for this message"]
    #[doc = " @return key string that is hashed to determine message's topic partition"]
    pub fn pulsar_message_get_partitionKey(
        message: *mut pulsar_message_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_message_has_partition_key(
        message: *mut pulsar_message_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Get the ordering key of the message for message dispatch in Key_Shared mode."]
    #[doc = " Partition key Will be used if ordering key not specified"]
    pub fn pulsar_message_get_orderingKey(
        message: *mut pulsar_message_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_message_has_ordering_key(message: *mut pulsar_message_t)
        -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Get the UTC based timestamp in milliseconds referring to when the message was published by the client"]
    #[doc = " producer"]
    pub fn pulsar_message_get_publish_timestamp(message: *mut pulsar_message_t) -> u64;
}
extern "C" {
    #[doc = " Get the event timestamp associated with this message. It is set by the client producer."]
    pub fn pulsar_message_get_event_timestamp(message: *mut pulsar_message_t) -> u64;
}
extern "C" {
    pub fn pulsar_message_get_topic_name(
        message: *mut pulsar_message_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_message_get_redelivery_count(
        message: *mut pulsar_message_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_message_has_schema_version(
        message: *mut pulsar_message_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_message_get_schemaVersion(
        message: *mut pulsar_message_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_message_set_schema_version(
        message: *mut pulsar_message_t,
        schemaVersion: *const ::std::os::raw::c_char,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_reader {
    _unused: [u8; 0],
}
pub type pulsar_reader_t = _pulsar_reader;
pub type pulsar_result_callback = ::std::option::Option<
    unsafe extern "C" fn(arg1: pulsar_result, arg2: *mut ::std::os::raw::c_void),
>;
extern "C" {
    #[doc = " @return the topic this reader is reading from"]
    pub fn pulsar_reader_get_topic(reader: *mut pulsar_reader_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Read a single message."]
    #[doc = ""]
    #[doc = " If a message is not immediately available, this method will block until a new"]
    #[doc = " message is available."]
    #[doc = ""]
    #[doc = " @param msg a non-const reference where the received message will be copied"]
    #[doc = " @return ResultOk when a message is received"]
    #[doc = " @return ResultInvalidConfiguration if a message listener had been set in the configuration"]
    pub fn pulsar_reader_read_next(
        reader: *mut pulsar_reader_t,
        msg: *mut *mut pulsar_message_t,
    ) -> pulsar_result;
}
extern "C" {
    #[doc = " Read a single message"]
    #[doc = ""]
    #[doc = " @param msg a non-const reference where the received message will be copied"]
    #[doc = " @param timeoutMs the receive timeout in milliseconds"]
    #[doc = " @return ResultOk if a message was received"]
    #[doc = " @return ResultTimeout if the receive timeout was triggered"]
    #[doc = " @return ResultInvalidConfiguration if a message listener had been set in the configuration"]
    pub fn pulsar_reader_read_next_with_timeout(
        reader: *mut pulsar_reader_t,
        msg: *mut *mut pulsar_message_t,
        timeoutMs: ::std::os::raw::c_int,
    ) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_reader_close(reader: *mut pulsar_reader_t) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_reader_close_async(
        reader: *mut pulsar_reader_t,
        callback: pulsar_result_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_reader_free(reader: *mut pulsar_reader_t);
}
extern "C" {
    pub fn pulsar_reader_has_message_available(
        reader: *mut pulsar_reader_t,
        available: *mut ::std::os::raw::c_int,
    ) -> pulsar_result;
}
pub const pulsar_logger_level_t_pulsar_DEBUG: pulsar_logger_level_t = 0;
pub const pulsar_logger_level_t_pulsar_INFO: pulsar_logger_level_t = 1;
pub const pulsar_logger_level_t_pulsar_WARN: pulsar_logger_level_t = 2;
pub const pulsar_logger_level_t_pulsar_ERROR: pulsar_logger_level_t = 3;
pub type pulsar_logger_level_t = ::std::os::raw::c_int;
pub type pulsar_logger = ::std::option::Option<
    unsafe extern "C" fn(
        level: pulsar_logger_level_t,
        file: *const ::std::os::raw::c_char,
        line: ::std::os::raw::c_int,
        message: *const ::std::os::raw::c_char,
        ctx: *mut ::std::os::raw::c_void,
    ),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_client_configuration {
    _unused: [u8; 0],
}
pub type pulsar_client_configuration_t = _pulsar_client_configuration;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_authentication {
    _unused: [u8; 0],
}
pub type pulsar_authentication_t = _pulsar_authentication;
extern "C" {
    pub fn pulsar_client_configuration_create() -> *mut pulsar_client_configuration_t;
}
extern "C" {
    pub fn pulsar_client_configuration_free(conf: *mut pulsar_client_configuration_t);
}
extern "C" {
    #[doc = " Set the authentication method to be used with the broker"]
    #[doc = ""]
    #[doc = " @param authentication the authentication data to use"]
    pub fn pulsar_client_configuration_set_auth(
        conf: *mut pulsar_client_configuration_t,
        authentication: *mut pulsar_authentication_t,
    );
}
extern "C" {
    #[doc = " Set timeout on client operations (subscribe, create producer, close, unsubscribe)"]
    #[doc = " Default is 30 seconds."]
    #[doc = ""]
    #[doc = " @param timeout the timeout after which the operation will be considered as failed"]
    pub fn pulsar_client_configuration_set_operation_timeout_seconds(
        conf: *mut pulsar_client_configuration_t,
        timeout: ::std::os::raw::c_int,
    );
}
extern "C" {
    #[doc = " @return the client operations timeout in seconds"]
    pub fn pulsar_client_configuration_get_operation_timeout_seconds(
        conf: *mut pulsar_client_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Set the number of IO threads to be used by the Pulsar client. Default is 1"]
    #[doc = " thread."]
    #[doc = ""]
    #[doc = " @param threads number of threads"]
    pub fn pulsar_client_configuration_set_io_threads(
        conf: *mut pulsar_client_configuration_t,
        threads: ::std::os::raw::c_int,
    );
}
extern "C" {
    #[doc = " @return the number of IO threads to use"]
    pub fn pulsar_client_configuration_get_io_threads(
        conf: *mut pulsar_client_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Set the number of threads to be used by the Pulsar client when delivering messages"]
    #[doc = " through message listener. Default is 1 thread per Pulsar client."]
    #[doc = ""]
    #[doc = " If using more than 1 thread, messages for distinct MessageListener will be"]
    #[doc = " delivered in different threads, however a single MessageListener will always"]
    #[doc = " be assigned to the same thread."]
    #[doc = ""]
    #[doc = " @param threads number of threads"]
    pub fn pulsar_client_configuration_set_message_listener_threads(
        conf: *mut pulsar_client_configuration_t,
        threads: ::std::os::raw::c_int,
    );
}
extern "C" {
    #[doc = " @return the number of IO threads to use"]
    pub fn pulsar_client_configuration_get_message_listener_threads(
        conf: *mut pulsar_client_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Number of concurrent lookup-requests allowed on each broker-connection to prevent overload on broker."]
    #[doc = " <i>(default: 50000)</i> It should be configured with higher value only in case of it requires to"]
    #[doc = " produce/subscribe on"]
    #[doc = " thousands of topic using created {@link PulsarClient}"]
    #[doc = ""]
    #[doc = " @param concurrentLookupRequest"]
    pub fn pulsar_client_configuration_set_concurrent_lookup_request(
        conf: *mut pulsar_client_configuration_t,
        concurrentLookupRequest: ::std::os::raw::c_int,
    );
}
extern "C" {
    #[doc = " @return Get configured total allowed concurrent lookup-request."]
    pub fn pulsar_client_configuration_get_concurrent_lookup_request(
        conf: *mut pulsar_client_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_client_configuration_set_logger(
        conf: *mut pulsar_client_configuration_t,
        logger: pulsar_logger,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_client_configuration_set_use_tls(
        conf: *mut pulsar_client_configuration_t,
        useTls: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_client_configuration_is_use_tls(
        conf: *mut pulsar_client_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_client_configuration_set_tls_trust_certs_file_path(
        conf: *mut pulsar_client_configuration_t,
        tlsTrustCertsFilePath: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn pulsar_client_configuration_get_tls_trust_certs_file_path(
        conf: *mut pulsar_client_configuration_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_client_configuration_set_tls_allow_insecure_connection(
        conf: *mut pulsar_client_configuration_t,
        allowInsecure: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_client_configuration_is_tls_allow_insecure_connection(
        conf: *mut pulsar_client_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_client_configuration_set_stats_interval_in_seconds(
        conf: *mut pulsar_client_configuration_t,
        interval: ::std::os::raw::c_uint,
    );
}
extern "C" {
    pub fn pulsar_client_configuration_is_validate_hostname(
        conf: *mut pulsar_client_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_client_configuration_set_validate_hostname(
        conf: *mut pulsar_client_configuration_t,
        validateHostName: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_client_configuration_get_stats_interval_in_seconds(
        conf: *mut pulsar_client_configuration_t,
    ) -> ::std::os::raw::c_uint;
}
extern "C" {
    #[doc = " MessageId representing the \"earliest\" or \"oldest available\" message stored in the topic"]
    pub fn pulsar_message_id_earliest() -> *const pulsar_message_id_t;
}
extern "C" {
    #[doc = " MessageId representing the \"latest\" or \"last published\" message in the topic"]
    pub fn pulsar_message_id_latest() -> *const pulsar_message_id_t;
}
extern "C" {
    #[doc = " Serialize the message id into a binary string for storing"]
    pub fn pulsar_message_id_serialize(
        messageId: *mut pulsar_message_id_t,
        len: *mut ::std::os::raw::c_int,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    #[doc = " Deserialize a message id from a binary string"]
    pub fn pulsar_message_id_deserialize(
        buffer: *const ::std::os::raw::c_void,
        len: u32,
    ) -> *mut pulsar_message_id_t;
}
extern "C" {
    pub fn pulsar_message_id_str(
        messageId: *mut pulsar_message_id_t,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_message_id_free(messageId: *mut pulsar_message_id_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_producer {
    _unused: [u8; 0],
}
pub type pulsar_producer_t = _pulsar_producer;
pub type pulsar_send_callback = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: pulsar_result,
        msgId: *mut pulsar_message_id_t,
        ctx: *mut ::std::os::raw::c_void,
    ),
>;
pub type pulsar_close_callback = ::std::option::Option<
    unsafe extern "C" fn(arg1: pulsar_result, ctx: *mut ::std::os::raw::c_void),
>;
pub type pulsar_flush_callback = ::std::option::Option<
    unsafe extern "C" fn(arg1: pulsar_result, ctx: *mut ::std::os::raw::c_void),
>;
extern "C" {
    #[doc = " @return the topic to which producer is publishing to"]
    pub fn pulsar_producer_get_topic(
        producer: *mut pulsar_producer_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " @return the producer name which could have been assigned by the system or specified by the client"]
    pub fn pulsar_producer_get_producer_name(
        producer: *mut pulsar_producer_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Publish a message on the topic associated with this Producer."]
    #[doc = ""]
    #[doc = " This method will block until the message will be accepted and persisted"]
    #[doc = " by the broker. In case of errors, the client library will try to"]
    #[doc = " automatically recover and use a different broker."]
    #[doc = ""]
    #[doc = " If it wasn't possible to successfully publish the message within the sendTimeout,"]
    #[doc = " an error will be returned."]
    #[doc = ""]
    #[doc = " This method is equivalent to asyncSend() and wait until the callback is triggered."]
    #[doc = ""]
    #[doc = " @param msg message to publish"]
    #[doc = " @return ResultOk if the message was published successfully"]
    #[doc = " @return ResultWriteError if it wasn't possible to publish the message"]
    pub fn pulsar_producer_send(
        producer: *mut pulsar_producer_t,
        msg: *mut pulsar_message_t,
    ) -> pulsar_result;
}
extern "C" {
    #[doc = " Asynchronously publish a message on the topic associated with this Producer."]
    #[doc = ""]
    #[doc = " This method will initiate the publish operation and return immediately. The"]
    #[doc = " provided callback will be triggered when the message has been be accepted and persisted"]
    #[doc = " by the broker. In case of errors, the client library will try to"]
    #[doc = " automatically recover and use a different broker."]
    #[doc = ""]
    #[doc = " If it wasn't possible to successfully publish the message within the sendTimeout, the"]
    #[doc = " callback will be triggered with a Result::WriteError code."]
    #[doc = ""]
    #[doc = " @param msg message to publish"]
    #[doc = " @param callback the callback to get notification of the completion"]
    pub fn pulsar_producer_send_async(
        producer: *mut pulsar_producer_t,
        msg: *mut pulsar_message_t,
        callback: pulsar_send_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " Get the last sequence id that was published by this producer."]
    #[doc = ""]
    #[doc = " This represent either the automatically assigned or custom sequence id (set on the MessageBuilder) that"]
    #[doc = " was published and acknowledged by the broker."]
    #[doc = ""]
    #[doc = " After recreating a producer with the same producer name, this will return the last message that was"]
    #[doc = " published in"]
    #[doc = " the previous producer session, or -1 if there no message was ever published."]
    #[doc = ""]
    #[doc = " @return the last sequence id published by this producer"]
    pub fn pulsar_producer_get_last_sequence_id(producer: *mut pulsar_producer_t) -> i64;
}
extern "C" {
    #[doc = " Close the producer and release resources allocated."]
    #[doc = ""]
    #[doc = " No more writes will be accepted from this producer. Waits until"]
    #[doc = " all pending write requests are persisted. In case of errors,"]
    #[doc = " pending writes will not be retried."]
    #[doc = ""]
    #[doc = " @return an error code to indicate the success or failure"]
    pub fn pulsar_producer_close(producer: *mut pulsar_producer_t) -> pulsar_result;
}
extern "C" {
    #[doc = " Close the producer and release resources allocated."]
    #[doc = ""]
    #[doc = " No more writes will be accepted from this producer. The provided callback will be"]
    #[doc = " triggered when all pending write requests are persisted. In case of errors,"]
    #[doc = " pending writes will not be retried."]
    pub fn pulsar_producer_close_async(
        producer: *mut pulsar_producer_t,
        callback: pulsar_close_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_producer_flush(producer: *mut pulsar_producer_t) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_producer_flush_async(
        producer: *mut pulsar_producer_t,
        callback: pulsar_flush_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_producer_free(producer: *mut pulsar_producer_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_consumer {
    _unused: [u8; 0],
}
pub type pulsar_consumer_t = _pulsar_consumer;
extern "C" {
    #[doc = " @return the topic this consumer is subscribed to"]
    pub fn pulsar_consumer_get_topic(
        consumer: *mut pulsar_consumer_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " @return the consumer name"]
    pub fn pulsar_consumer_get_subscription_name(
        consumer: *mut pulsar_consumer_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Unsubscribe the current consumer from the topic."]
    #[doc = ""]
    #[doc = " This method will block until the operation is completed. Once the consumer is"]
    #[doc = " unsubscribed, no more messages will be received and subsequent new messages"]
    #[doc = " will not be retained for this consumer."]
    #[doc = ""]
    #[doc = " This consumer object cannot be reused."]
    #[doc = ""]
    #[doc = " @see asyncUnsubscribe"]
    #[doc = " @return Result::ResultOk if the unsubscribe operation completed successfully"]
    #[doc = " @return Result::ResultError if the unsubscribe operation failed"]
    pub fn pulsar_consumer_unsubscribe(consumer: *mut pulsar_consumer_t) -> pulsar_result;
}
extern "C" {
    #[doc = " Asynchronously unsubscribe the current consumer from the topic."]
    #[doc = ""]
    #[doc = " This method will block until the operation is completed. Once the consumer is"]
    #[doc = " unsubscribed, no more messages will be received and subsequent new messages"]
    #[doc = " will not be retained for this consumer."]
    #[doc = ""]
    #[doc = " This consumer object cannot be reused."]
    #[doc = ""]
    #[doc = " @param callback the callback to get notified when the operation is complete"]
    pub fn pulsar_consumer_unsubscribe_async(
        consumer: *mut pulsar_consumer_t,
        callback: pulsar_result_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " Receive a single message."]
    #[doc = ""]
    #[doc = " If a message is not immediately available, this method will block until a new"]
    #[doc = " message is available."]
    #[doc = ""]
    #[doc = " @param msg a non-const reference where the received message will be copied"]
    #[doc = " @return ResultOk when a message is received"]
    #[doc = " @return ResultInvalidConfiguration if a message listener had been set in the configuration"]
    pub fn pulsar_consumer_receive(
        consumer: *mut pulsar_consumer_t,
        msg: *mut *mut pulsar_message_t,
    ) -> pulsar_result;
}
extern "C" {
    #[doc = " @param msg a non-const reference where the received message will be copied"]
    #[doc = " @param timeoutMs the receive timeout in milliseconds"]
    #[doc = " @return ResultOk if a message was received"]
    #[doc = " @return ResultTimeout if the receive timeout was triggered"]
    #[doc = " @return ResultInvalidConfiguration if a message listener had been set in the configuration"]
    pub fn pulsar_consumer_receive_with_timeout(
        consumer: *mut pulsar_consumer_t,
        msg: *mut *mut pulsar_message_t,
        timeoutMs: ::std::os::raw::c_int,
    ) -> pulsar_result;
}
extern "C" {
    #[doc = " Acknowledge the reception of a single message."]
    #[doc = ""]
    #[doc = " This method will block until an acknowledgement is sent to the broker. After"]
    #[doc = " that, the message will not be re-delivered to this consumer."]
    #[doc = ""]
    #[doc = " @see asyncAcknowledge"]
    #[doc = " @param message the message to acknowledge"]
    #[doc = " @return ResultOk if the message was successfully acknowledged"]
    #[doc = " @return ResultError if there was a failure"]
    pub fn pulsar_consumer_acknowledge(
        consumer: *mut pulsar_consumer_t,
        message: *mut pulsar_message_t,
    ) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_consumer_acknowledge_id(
        consumer: *mut pulsar_consumer_t,
        messageId: *mut pulsar_message_id_t,
    ) -> pulsar_result;
}
extern "C" {
    #[doc = " Asynchronously acknowledge the reception of a single message."]
    #[doc = ""]
    #[doc = " This method will initiate the operation and return immediately. The provided callback"]
    #[doc = " will be triggered when the operation is complete."]
    #[doc = ""]
    #[doc = " @param message the message to acknowledge"]
    #[doc = " @param callback callback that will be triggered when the message has been acknowledged"]
    pub fn pulsar_consumer_acknowledge_async(
        consumer: *mut pulsar_consumer_t,
        message: *mut pulsar_message_t,
        callback: pulsar_result_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_consumer_acknowledge_async_id(
        consumer: *mut pulsar_consumer_t,
        messageId: *mut pulsar_message_id_t,
        callback: pulsar_result_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " Acknowledge the reception of all the messages in the stream up to (and including)"]
    #[doc = " the provided message."]
    #[doc = ""]
    #[doc = " This method will block until an acknowledgement is sent to the broker. After"]
    #[doc = " that, the messages will not be re-delivered to this consumer."]
    #[doc = ""]
    #[doc = " Cumulative acknowledge cannot be used when the consumer type is set to ConsumerShared."]
    #[doc = ""]
    #[doc = " It's equivalent to calling asyncAcknowledgeCumulative(const Message&, ResultCallback) and"]
    #[doc = " waiting for the callback to be triggered."]
    #[doc = ""]
    #[doc = " @param message the last message in the stream to acknowledge"]
    #[doc = " @return ResultOk if the message was successfully acknowledged. All previously delivered messages for"]
    #[doc = " this topic are also acknowledged."]
    #[doc = " @return ResultError if there was a failure"]
    pub fn pulsar_consumer_acknowledge_cumulative(
        consumer: *mut pulsar_consumer_t,
        message: *mut pulsar_message_t,
    ) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_consumer_acknowledge_cumulative_id(
        consumer: *mut pulsar_consumer_t,
        messageId: *mut pulsar_message_id_t,
    ) -> pulsar_result;
}
extern "C" {
    #[doc = " Asynchronously acknowledge the reception of all the messages in the stream up to (and"]
    #[doc = " including) the provided message."]
    #[doc = ""]
    #[doc = " This method will initiate the operation and return immediately. The provided callback"]
    #[doc = " will be triggered when the operation is complete."]
    #[doc = ""]
    #[doc = " @param message the message to acknowledge"]
    #[doc = " @param callback callback that will be triggered when the message has been acknowledged"]
    pub fn pulsar_consumer_acknowledge_cumulative_async(
        consumer: *mut pulsar_consumer_t,
        message: *mut pulsar_message_t,
        callback: pulsar_result_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_consumer_acknowledge_cumulative_async_id(
        consumer: *mut pulsar_consumer_t,
        messageId: *mut pulsar_message_id_t,
        callback: pulsar_result_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " Acknowledge the failure to process a single message."]
    #[doc = " <p>"]
    #[doc = " When a message is \"negatively acked\" it will be marked for redelivery after"]
    #[doc = " some fixed delay. The delay is configurable when constructing the consumer"]
    #[doc = " with {@link ConsumerConfiguration#setNegativeAckRedeliveryDelayMs}."]
    #[doc = " <p>"]
    #[doc = " This call is not blocking."]
    #[doc = ""]
    #[doc = " @param message"]
    #[doc = "            The {@code Message} to be acknowledged"]
    pub fn pulsar_consumer_negative_acknowledge(
        consumer: *mut pulsar_consumer_t,
        message: *mut pulsar_message_t,
    );
}
extern "C" {
    #[doc = " Acknowledge the failure to process a single message through its message id"]
    #[doc = " <p>"]
    #[doc = " When a message is \"negatively acked\" it will be marked for redelivery after"]
    #[doc = " some fixed delay. The delay is configurable when constructing the consumer"]
    #[doc = " with {@link ConsumerConfiguration#setNegativeAckRedeliveryDelayMs}."]
    #[doc = " <p>"]
    #[doc = " This call is not blocking."]
    #[doc = ""]
    #[doc = " @param message"]
    #[doc = "            The message id to be acknowledged"]
    pub fn pulsar_consumer_negative_acknowledge_id(
        consumer: *mut pulsar_consumer_t,
        messageId: *mut pulsar_message_id_t,
    );
}
extern "C" {
    pub fn pulsar_consumer_close(consumer: *mut pulsar_consumer_t) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_consumer_close_async(
        consumer: *mut pulsar_consumer_t,
        callback: pulsar_result_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_consumer_free(consumer: *mut pulsar_consumer_t);
}
extern "C" {
    pub fn pulsar_consumer_pause_message_listener(
        consumer: *mut pulsar_consumer_t,
    ) -> pulsar_result;
}
extern "C" {
    pub fn resume_message_listener(consumer: *mut pulsar_consumer_t) -> pulsar_result;
}
extern "C" {
    #[doc = " Redelivers all the unacknowledged messages. In Failover mode, the request is ignored if the consumer is"]
    #[doc = " not"]
    #[doc = " active for the given topic. In Shared mode, the consumers messages to be redelivered are distributed"]
    #[doc = " across all"]
    #[doc = " the connected consumers. This is a non blocking call and doesn't throw an exception. In case the"]
    #[doc = " connection"]
    #[doc = " breaks, the messages are redelivered after reconnect."]
    pub fn pulsar_consumer_redeliver_unacknowledged_messages(consumer: *mut pulsar_consumer_t);
}
extern "C" {
    pub fn pulsar_consumer_seek_async(
        consumer: *mut pulsar_consumer_t,
        messageId: *mut pulsar_message_id_t,
        callback: pulsar_result_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_consumer_seek(
        consumer: *mut pulsar_consumer_t,
        messageId: *mut pulsar_message_id_t,
    ) -> pulsar_result;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_topic_metadata {
    _unused: [u8; 0],
}
pub type pulsar_topic_metadata_t = _pulsar_topic_metadata;
pub type pulsar_message_router = ::std::option::Option<
    unsafe extern "C" fn(
        msg: *mut pulsar_message_t,
        topicMetadata: *mut pulsar_topic_metadata_t,
        ctx: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn pulsar_topic_metadata_get_num_partitions(
        topicMetadata: *mut pulsar_topic_metadata_t,
    ) -> ::std::os::raw::c_int;
}
pub const pulsar_partitions_routing_mode_pulsar_UseSinglePartition: pulsar_partitions_routing_mode =
    0;
pub const pulsar_partitions_routing_mode_pulsar_RoundRobinDistribution:
    pulsar_partitions_routing_mode = 1;
pub const pulsar_partitions_routing_mode_pulsar_CustomPartition: pulsar_partitions_routing_mode = 2;
pub type pulsar_partitions_routing_mode = ::std::os::raw::c_int;
pub const pulsar_hashing_scheme_pulsar_Murmur3_32Hash: pulsar_hashing_scheme = 0;
pub const pulsar_hashing_scheme_pulsar_BoostHash: pulsar_hashing_scheme = 1;
pub const pulsar_hashing_scheme_pulsar_JavaStringHash: pulsar_hashing_scheme = 2;
pub type pulsar_hashing_scheme = ::std::os::raw::c_int;
pub const pulsar_compression_type_pulsar_CompressionNone: pulsar_compression_type = 0;
pub const pulsar_compression_type_pulsar_CompressionLZ4: pulsar_compression_type = 1;
pub const pulsar_compression_type_pulsar_CompressionZLib: pulsar_compression_type = 2;
pub const pulsar_compression_type_pulsar_CompressionZSTD: pulsar_compression_type = 3;
pub const pulsar_compression_type_pulsar_CompressionSNAPPY: pulsar_compression_type = 4;
pub type pulsar_compression_type = ::std::os::raw::c_int;
pub const pulsar_schema_type_pulsar_None: pulsar_schema_type = 0;
pub const pulsar_schema_type_pulsar_String: pulsar_schema_type = 1;
pub const pulsar_schema_type_pulsar_Json: pulsar_schema_type = 2;
pub const pulsar_schema_type_pulsar_Protobuf: pulsar_schema_type = 3;
pub const pulsar_schema_type_pulsar_Avro: pulsar_schema_type = 4;
pub const pulsar_schema_type_pulsar_Boolean: pulsar_schema_type = 5;
pub const pulsar_schema_type_pulsar_Int8: pulsar_schema_type = 6;
pub const pulsar_schema_type_pulsar_Int16: pulsar_schema_type = 7;
pub const pulsar_schema_type_pulsar_Int32: pulsar_schema_type = 8;
pub const pulsar_schema_type_pulsar_Int64: pulsar_schema_type = 9;
pub const pulsar_schema_type_pulsar_Float32: pulsar_schema_type = 10;
pub const pulsar_schema_type_pulsar_Float64: pulsar_schema_type = 11;
pub const pulsar_schema_type_pulsar_KeyValue: pulsar_schema_type = 15;
pub const pulsar_schema_type_pulsar_Bytes: pulsar_schema_type = -1;
pub const pulsar_schema_type_pulsar_AutoConsume: pulsar_schema_type = -3;
pub const pulsar_schema_type_pulsar_AutoPublish: pulsar_schema_type = -4;
pub type pulsar_schema_type = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_producer_configuration {
    _unused: [u8; 0],
}
pub type pulsar_producer_configuration_t = _pulsar_producer_configuration;
extern "C" {
    pub fn pulsar_producer_configuration_create() -> *mut pulsar_producer_configuration_t;
}
extern "C" {
    pub fn pulsar_producer_configuration_free(conf: *mut pulsar_producer_configuration_t);
}
extern "C" {
    pub fn pulsar_producer_configuration_set_producer_name(
        conf: *mut pulsar_producer_configuration_t,
        producerName: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_producer_name(
        conf: *mut pulsar_producer_configuration_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_send_timeout(
        conf: *mut pulsar_producer_configuration_t,
        sendTimeoutMs: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_send_timeout(
        conf: *mut pulsar_producer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_initial_sequence_id(
        conf: *mut pulsar_producer_configuration_t,
        initialSequenceId: i64,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_initial_sequence_id(
        conf: *mut pulsar_producer_configuration_t,
    ) -> i64;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_compression_type(
        conf: *mut pulsar_producer_configuration_t,
        compressionType: pulsar_compression_type,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_compression_type(
        conf: *mut pulsar_producer_configuration_t,
    ) -> pulsar_compression_type;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_schema_info(
        conf: *mut pulsar_producer_configuration_t,
        schemaType: pulsar_schema_type,
        name: *const ::std::os::raw::c_char,
        schema: *const ::std::os::raw::c_char,
        properties: *mut pulsar_string_map_t,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_set_max_pending_messages(
        conf: *mut pulsar_producer_configuration_t,
        maxPendingMessages: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_max_pending_messages(
        conf: *mut pulsar_producer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Set the number of max pending messages across all the partitions"]
    #[doc = " <p>"]
    #[doc = " This setting will be used to lower the max pending messages for each partition"]
    #[doc = " ({@link #setMaxPendingMessages(int)}), if the total exceeds the configured value."]
    #[doc = ""]
    #[doc = " @param maxPendingMessagesAcrossPartitions"]
    pub fn pulsar_producer_configuration_set_max_pending_messages_across_partitions(
        conf: *mut pulsar_producer_configuration_t,
        maxPendingMessagesAcrossPartitions: ::std::os::raw::c_int,
    );
}
extern "C" {
    #[doc = " @return the maximum number of pending messages allowed across all the partitions"]
    pub fn pulsar_producer_configuration_get_max_pending_messages_across_partitions(
        conf: *mut pulsar_producer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_partitions_routing_mode(
        conf: *mut pulsar_producer_configuration_t,
        mode: pulsar_partitions_routing_mode,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_partitions_routing_mode(
        conf: *mut pulsar_producer_configuration_t,
    ) -> pulsar_partitions_routing_mode;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_message_router(
        conf: *mut pulsar_producer_configuration_t,
        router: pulsar_message_router,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_set_hashing_scheme(
        conf: *mut pulsar_producer_configuration_t,
        scheme: pulsar_hashing_scheme,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_hashing_scheme(
        conf: *mut pulsar_producer_configuration_t,
    ) -> pulsar_hashing_scheme;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_block_if_queue_full(
        conf: *mut pulsar_producer_configuration_t,
        blockIfQueueFull: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_block_if_queue_full(
        conf: *mut pulsar_producer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_batching_enabled(
        conf: *mut pulsar_producer_configuration_t,
        batchingEnabled: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_batching_enabled(
        conf: *mut pulsar_producer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_batching_max_messages(
        conf: *mut pulsar_producer_configuration_t,
        batchingMaxMessages: ::std::os::raw::c_uint,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_batching_max_messages(
        conf: *mut pulsar_producer_configuration_t,
    ) -> ::std::os::raw::c_uint;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_batching_max_allowed_size_in_bytes(
        conf: *mut pulsar_producer_configuration_t,
        batchingMaxAllowedSizeInBytes: ::std::os::raw::c_ulong,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_batching_max_allowed_size_in_bytes(
        conf: *mut pulsar_producer_configuration_t,
    ) -> ::std::os::raw::c_ulong;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_batching_max_publish_delay_ms(
        conf: *mut pulsar_producer_configuration_t,
        batchingMaxPublishDelayMs: ::std::os::raw::c_ulong,
    );
}
extern "C" {
    pub fn pulsar_producer_configuration_get_batching_max_publish_delay_ms(
        conf: *mut pulsar_producer_configuration_t,
    ) -> ::std::os::raw::c_ulong;
}
extern "C" {
    pub fn pulsar_producer_configuration_set_property(
        conf: *mut pulsar_producer_configuration_t,
        name: *const ::std::os::raw::c_char,
        value: *const ::std::os::raw::c_char,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_consumer_configuration {
    _unused: [u8; 0],
}
pub type pulsar_consumer_configuration_t = _pulsar_consumer_configuration;
#[doc = " There can be only 1 consumer on the same topic with the same consumerName"]
pub const pulsar_consumer_type_pulsar_ConsumerExclusive: pulsar_consumer_type = 0;
#[doc = " Multiple consumers will be able to use the same consumerName and the messages"]
#[doc = "  will be dispatched according to a round-robin rotation between the connected consumers"]
pub const pulsar_consumer_type_pulsar_ConsumerShared: pulsar_consumer_type = 1;
#[doc = " Only one consumer is active on the subscription; Subscription can have N consumers"]
#[doc = "  connected one of which will get promoted to master if the current master becomes inactive"]
pub const pulsar_consumer_type_pulsar_ConsumerFailover: pulsar_consumer_type = 2;
#[doc = " Multiple consumer will be able to use the same subscription and all messages with the same key"]
#[doc = " will be dispatched to only one consumer"]
pub const pulsar_consumer_type_pulsar_ConsumerKeyShared: pulsar_consumer_type = 3;
pub type pulsar_consumer_type = ::std::os::raw::c_int;
#[doc = " the latest position which means the start consuming position will be the last message"]
pub const initial_position_initial_position_latest: initial_position = 0;
#[doc = " the earliest position which means the start consuming position will be the first message"]
pub const initial_position_initial_position_earliest: initial_position = 1;
pub type initial_position = ::std::os::raw::c_int;
#[doc = " Callback definition for MessageListener"]
pub type pulsar_message_listener = ::std::option::Option<
    unsafe extern "C" fn(
        consumer: *mut pulsar_consumer_t,
        msg: *mut pulsar_message_t,
        ctx: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn pulsar_consumer_configuration_create() -> *mut pulsar_consumer_configuration_t;
}
extern "C" {
    pub fn pulsar_consumer_configuration_free(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    );
}
extern "C" {
    #[doc = " Specify the consumer type. The consumer type enables"]
    #[doc = " specifying the type of subscription. In Exclusive subscription,"]
    #[doc = " only a single consumer is allowed to attach to the subscription. Other consumers"]
    #[doc = " will get an error message. In Shared subscription, multiple consumers will be"]
    #[doc = " able to use the same subscription name and the messages will be dispatched in a"]
    #[doc = " round robin fashion. In Failover subscription, a primary-failover subscription model"]
    #[doc = " allows for multiple consumers to attach to a single subscription, though only one"]
    #[doc = " of them will be “master” at a given time. Only the primary consumer will receive"]
    #[doc = " messages. When the primary consumer gets disconnected, one among the failover"]
    #[doc = " consumers will be promoted to primary and will start getting messages."]
    pub fn pulsar_consumer_configuration_set_consumer_type(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        consumerType: pulsar_consumer_type,
    );
}
extern "C" {
    pub fn pulsar_consumer_configuration_get_consumer_type(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> pulsar_consumer_type;
}
extern "C" {
    pub fn pulsar_consumer_configuration_set_schema_info(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        schemaType: pulsar_schema_type,
        name: *const ::std::os::raw::c_char,
        schema: *const ::std::os::raw::c_char,
        properties: *mut pulsar_string_map_t,
    );
}
extern "C" {
    #[doc = " A message listener enables your application to configure how to process"]
    #[doc = " and acknowledge messages delivered. A listener will be called in order"]
    #[doc = " for every message received."]
    pub fn pulsar_consumer_configuration_set_message_listener(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        messageListener: pulsar_message_listener,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_consumer_configuration_has_message_listener(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Sets the size of the consumer receive queue."]
    #[doc = ""]
    #[doc = " The consumer receive queue controls how many messages can be accumulated by the Consumer before the"]
    #[doc = " application calls receive(). Using a higher value could potentially increase the consumer throughput"]
    #[doc = " at the expense of bigger memory utilization."]
    #[doc = ""]
    #[doc = " Setting the consumer queue size as zero decreases the throughput of the consumer, by disabling"]
    #[doc = " pre-fetching of"]
    #[doc = " messages. This approach improves the message distribution on shared subscription, by pushing messages"]
    #[doc = " only to"]
    #[doc = " the consumers that are ready to process them. Neither receive with timeout nor Partitioned Topics can"]
    #[doc = " be"]
    #[doc = " used if the consumer queue size is zero. The receive() function call should not be interrupted when"]
    #[doc = " the consumer queue size is zero."]
    #[doc = ""]
    #[doc = " Default value is 1000 messages and should be good for most use cases."]
    #[doc = ""]
    #[doc = " @param size"]
    #[doc = "            the new receiver queue size value"]
    pub fn pulsar_consumer_configuration_set_receiver_queue_size(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        size: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_consumer_configuration_get_receiver_queue_size(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Set the max total receiver queue size across partitons."]
    #[doc = " <p>"]
    #[doc = " This setting will be used to reduce the receiver queue size for individual partitions"]
    #[doc = " {@link #setReceiverQueueSize(int)} if the total exceeds this value (default: 50000)."]
    #[doc = ""]
    #[doc = " @param maxTotalReceiverQueueSizeAcrossPartitions"]
    pub fn pulsar_consumer_set_max_total_receiver_queue_size_across_partitions(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        maxTotalReceiverQueueSizeAcrossPartitions: ::std::os::raw::c_int,
    );
}
extern "C" {
    #[doc = " @return the configured max total receiver queue size across partitions"]
    pub fn pulsar_consumer_get_max_total_receiver_queue_size_across_partitions(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_consumer_set_consumer_name(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        consumerName: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn pulsar_consumer_get_consumer_name(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Set the timeout in milliseconds for unacknowledged messages, the timeout needs to be greater than"]
    #[doc = " 10 seconds. An Exception is thrown if the given value is less than 10000 (10 seconds)."]
    #[doc = " If a successful acknowledgement is not sent within the timeout all the unacknowledged messages are"]
    #[doc = " redelivered."]
    #[doc = " @param timeout in milliseconds"]
    pub fn pulsar_consumer_set_unacked_messages_timeout_ms(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        milliSeconds: u64,
    );
}
extern "C" {
    #[doc = " @return the configured timeout in milliseconds for unacked messages."]
    pub fn pulsar_consumer_get_unacked_messages_timeout_ms(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_long;
}
extern "C" {
    #[doc = " Set the delay to wait before re-delivering messages that have failed to be process."]
    #[doc = " <p>"]
    #[doc = " When application uses {@link Consumer#negativeAcknowledge(Message)}, the failed message"]
    #[doc = " will be redelivered after a fixed timeout. The default is 1 min."]
    #[doc = ""]
    #[doc = " @param redeliveryDelay"]
    #[doc = "            redelivery delay for failed messages"]
    #[doc = " @param timeUnit"]
    #[doc = "            unit in which the timeout is provided."]
    #[doc = " @return the consumer builder instance"]
    pub fn pulsar_configure_set_negative_ack_redelivery_delay_ms(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        redeliveryDelayMillis: ::std::os::raw::c_long,
    );
}
extern "C" {
    #[doc = " Get the configured delay to wait before re-delivering messages that have failed to be process."]
    #[doc = ""]
    #[doc = " @param consumer_configuration the consumer conf object"]
    #[doc = " @return redelivery delay for failed messages"]
    pub fn pulsar_configure_get_negative_ack_redelivery_delay_ms(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_long;
}
extern "C" {
    #[doc = " Set time window in milliseconds for grouping message ACK requests. An ACK request is not sent"]
    #[doc = " to broker until the time window reaches its end, or the number of grouped messages reaches"]
    #[doc = " limit. Default is 100 milliseconds. If it's set to a non-positive value, ACK requests will be"]
    #[doc = " directly sent to broker without grouping."]
    #[doc = ""]
    #[doc = " @param consumer_configuration the consumer conf object"]
    #[doc = " @param ackGroupMillis time of ACK grouping window in milliseconds."]
    pub fn pulsar_configure_set_ack_grouping_time_ms(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        ackGroupingMillis: ::std::os::raw::c_long,
    );
}
extern "C" {
    #[doc = " Get grouping time window in milliseconds."]
    #[doc = ""]
    #[doc = " @param consumer_configuration the consumer conf object"]
    #[doc = " @return grouping time window in milliseconds."]
    pub fn pulsar_configure_get_ack_grouping_time_ms(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_long;
}
extern "C" {
    #[doc = " Set max number of grouped messages within one grouping time window. If it's set to a"]
    #[doc = " non-positive value, number of grouped messages is not limited. Default is 1000."]
    #[doc = ""]
    #[doc = " @param consumer_configuration the consumer conf object"]
    #[doc = " @param maxGroupingSize max number of grouped messages with in one grouping time window."]
    pub fn pulsar_configure_set_ack_grouping_max_size(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        maxGroupingSize: ::std::os::raw::c_long,
    );
}
extern "C" {
    #[doc = " Get max number of grouped messages within one grouping time window."]
    #[doc = ""]
    #[doc = " @param consumer_configuration the consumer conf object"]
    #[doc = " @return max number of grouped messages within one grouping time window."]
    pub fn pulsar_configure_get_ack_grouping_max_size(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_long;
}
extern "C" {
    pub fn pulsar_consumer_is_encryption_enabled(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_consumer_is_read_compacted(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_consumer_set_read_compacted(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        compacted: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_consumer_get_subscription_initial_position(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_consumer_set_subscription_initial_position(
        consumer_configuration: *mut pulsar_consumer_configuration_t,
        subscriptionInitialPosition: initial_position,
    );
}
extern "C" {
    pub fn pulsar_consumer_configuration_set_property(
        conf: *mut pulsar_consumer_configuration_t,
        name: *const ::std::os::raw::c_char,
        value: *const ::std::os::raw::c_char,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_reader_configuration {
    _unused: [u8; 0],
}
pub type pulsar_reader_configuration_t = _pulsar_reader_configuration;
pub type pulsar_reader_listener = ::std::option::Option<
    unsafe extern "C" fn(
        reader: *mut pulsar_reader_t,
        msg: *mut pulsar_message_t,
        ctx: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn pulsar_reader_configuration_create() -> *mut pulsar_reader_configuration_t;
}
extern "C" {
    pub fn pulsar_reader_configuration_free(configuration: *mut pulsar_reader_configuration_t);
}
extern "C" {
    #[doc = " A message listener enables your application to configure how to process"]
    #[doc = " messages. A listener will be called in order for every message received."]
    pub fn pulsar_reader_configuration_set_reader_listener(
        configuration: *mut pulsar_reader_configuration_t,
        listener: pulsar_reader_listener,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_reader_configuration_has_reader_listener(
        configuration: *mut pulsar_reader_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Sets the size of the reader receive queue."]
    #[doc = ""]
    #[doc = " The consumer receive queue controls how many messages can be accumulated by the Consumer before the"]
    #[doc = " application calls receive(). Using a higher value could potentially increase the consumer throughput"]
    #[doc = " at the expense of bigger memory utilization."]
    #[doc = ""]
    #[doc = " Setting the consumer queue size as zero decreases the throughput of the consumer, by disabling"]
    #[doc = " pre-fetching of"]
    #[doc = " messages. This approach improves the message distribution on shared subscription, by pushing messages"]
    #[doc = " only to"]
    #[doc = " the consumers that are ready to process them. Neither receive with timeout nor Partitioned Topics can"]
    #[doc = " be"]
    #[doc = " used if the consumer queue size is zero. The receive() function call should not be interrupted when"]
    #[doc = " the consumer queue size is zero."]
    #[doc = ""]
    #[doc = " Default value is 1000 messages and should be good for most use cases."]
    #[doc = ""]
    #[doc = " @param size"]
    #[doc = "            the new receiver queue size value"]
    pub fn pulsar_reader_configuration_set_receiver_queue_size(
        configuration: *mut pulsar_reader_configuration_t,
        size: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_reader_configuration_get_receiver_queue_size(
        configuration: *mut pulsar_reader_configuration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn pulsar_reader_configuration_set_reader_name(
        configuration: *mut pulsar_reader_configuration_t,
        readerName: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn pulsar_reader_configuration_get_reader_name(
        configuration: *mut pulsar_reader_configuration_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_reader_configuration_set_subscription_role_prefix(
        configuration: *mut pulsar_reader_configuration_t,
        subscriptionRolePrefix: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn pulsar_reader_configuration_get_subscription_role_prefix(
        configuration: *mut pulsar_reader_configuration_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn pulsar_reader_configuration_set_read_compacted(
        configuration: *mut pulsar_reader_configuration_t,
        readCompacted: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn pulsar_reader_configuration_is_read_compacted(
        configuration: *mut pulsar_reader_configuration_t,
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _pulsar_client {
    _unused: [u8; 0],
}
pub type pulsar_client_t = _pulsar_client;
pub type pulsar_create_producer_callback = ::std::option::Option<
    unsafe extern "C" fn(
        result: pulsar_result,
        producer: *mut pulsar_producer_t,
        ctx: *mut ::std::os::raw::c_void,
    ),
>;
pub type pulsar_subscribe_callback = ::std::option::Option<
    unsafe extern "C" fn(
        result: pulsar_result,
        consumer: *mut pulsar_consumer_t,
        ctx: *mut ::std::os::raw::c_void,
    ),
>;
pub type pulsar_reader_callback = ::std::option::Option<
    unsafe extern "C" fn(
        result: pulsar_result,
        reader: *mut pulsar_reader_t,
        ctx: *mut ::std::os::raw::c_void,
    ),
>;
pub type pulsar_get_partitions_callback = ::std::option::Option<
    unsafe extern "C" fn(
        result: pulsar_result,
        partitions: *mut pulsar_string_list_t,
        ctx: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    #[doc = " Create a Pulsar client object connecting to the specified cluster address and using the specified"]
    #[doc = " configuration."]
    #[doc = ""]
    #[doc = " @param serviceUrl the Pulsar endpoint to use (eg: pulsar://broker-example.com:6650)"]
    #[doc = " @param clientConfiguration the client configuration to use"]
    pub fn pulsar_client_create(
        serviceUrl: *const ::std::os::raw::c_char,
        clientConfiguration: *const pulsar_client_configuration_t,
    ) -> *mut pulsar_client_t;
}
extern "C" {
    #[doc = " Create a producer with default configuration"]
    #[doc = ""]
    #[doc = " @see createProducer(const std::string&, const ProducerConfiguration&, Producer&)"]
    #[doc = ""]
    #[doc = " @param topic the topic where the new producer will publish"]
    #[doc = " @param producer a non-const reference where the new producer will be copied"]
    #[doc = " @return ResultOk if the producer has been successfully created"]
    #[doc = " @return ResultError if there was an error"]
    pub fn pulsar_client_create_producer(
        client: *mut pulsar_client_t,
        topic: *const ::std::os::raw::c_char,
        conf: *const pulsar_producer_configuration_t,
        producer: *mut *mut pulsar_producer_t,
    ) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_client_create_producer_async(
        client: *mut pulsar_client_t,
        topic: *const ::std::os::raw::c_char,
        conf: *const pulsar_producer_configuration_t,
        callback: pulsar_create_producer_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_client_subscribe(
        client: *mut pulsar_client_t,
        topic: *const ::std::os::raw::c_char,
        subscriptionName: *const ::std::os::raw::c_char,
        conf: *const pulsar_consumer_configuration_t,
        consumer: *mut *mut pulsar_consumer_t,
    ) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_client_subscribe_async(
        client: *mut pulsar_client_t,
        topic: *const ::std::os::raw::c_char,
        subscriptionName: *const ::std::os::raw::c_char,
        conf: *const pulsar_consumer_configuration_t,
        callback: pulsar_subscribe_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_client_subscribe_multi_topics_async(
        client: *mut pulsar_client_t,
        topics: *mut *const ::std::os::raw::c_char,
        topicsCount: ::std::os::raw::c_int,
        subscriptionName: *const ::std::os::raw::c_char,
        conf: *const pulsar_consumer_configuration_t,
        callback: pulsar_subscribe_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_client_subscribe_pattern_async(
        client: *mut pulsar_client_t,
        topicPattern: *const ::std::os::raw::c_char,
        subscriptionName: *const ::std::os::raw::c_char,
        conf: *const pulsar_consumer_configuration_t,
        callback: pulsar_subscribe_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " Create a topic reader with given {@code ReaderConfiguration} for reading messages from the specified"]
    #[doc = " topic."]
    #[doc = " <p>"]
    #[doc = " The Reader provides a low-level abstraction that allows for manual positioning in the topic, without"]
    #[doc = " using a"]
    #[doc = " subscription. Reader can only work on non-partitioned topics."]
    #[doc = " <p>"]
    #[doc = " The initial reader positioning is done by specifying a message id. The options are:"]
    #[doc = " <ul>"]
    #[doc = " <li><code>MessageId.earliest</code> : Start reading from the earliest message available in the topic"]
    #[doc = " <li><code>MessageId.latest</code> : Start reading from the end topic, only getting messages published"]
    #[doc = " after the"]
    #[doc = " reader was created"]
    #[doc = " <li><code>MessageId</code> : When passing a particular message id, the reader will position itself on"]
    #[doc = " that"]
    #[doc = " specific position. The first message to be read will be the message next to the specified messageId."]
    #[doc = " </ul>"]
    #[doc = ""]
    #[doc = " @param topic"]
    #[doc = "            The name of the topic where to read"]
    #[doc = " @param startMessageId"]
    #[doc = "            The message id where the reader will position itself. The first message returned will be the"]
    #[doc = " one after"]
    #[doc = "            the specified startMessageId"]
    #[doc = " @param conf"]
    #[doc = "            The {@code ReaderConfiguration} object"]
    #[doc = " @return The {@code Reader} object"]
    pub fn pulsar_client_create_reader(
        client: *mut pulsar_client_t,
        topic: *const ::std::os::raw::c_char,
        startMessageId: *const pulsar_message_id_t,
        conf: *mut pulsar_reader_configuration_t,
        reader: *mut *mut pulsar_reader_t,
    ) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_client_create_reader_async(
        client: *mut pulsar_client_t,
        topic: *const ::std::os::raw::c_char,
        startMessageId: *const pulsar_message_id_t,
        conf: *mut pulsar_reader_configuration_t,
        callback: pulsar_reader_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_client_get_topic_partitions(
        client: *mut pulsar_client_t,
        topic: *const ::std::os::raw::c_char,
        partitions: *mut *mut pulsar_string_list_t,
    ) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_client_get_topic_partitions_async(
        client: *mut pulsar_client_t,
        topic: *const ::std::os::raw::c_char,
        callback: pulsar_get_partitions_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_client_close(client: *mut pulsar_client_t) -> pulsar_result;
}
extern "C" {
    pub fn pulsar_client_close_async(
        client: *mut pulsar_client_t,
        callback: pulsar_close_callback,
        ctx: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn pulsar_client_free(client: *mut pulsar_client_t);
}
pub type token_supplier = ::std::option::Option<
    unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char,
>;
extern "C" {
    pub fn pulsar_authentication_create(
        dynamicLibPath: *const ::std::os::raw::c_char,
        authParamsString: *const ::std::os::raw::c_char,
    ) -> *mut pulsar_authentication_t;
}
extern "C" {
    pub fn pulsar_authentication_tls_create(
        certificatePath: *const ::std::os::raw::c_char,
        privateKeyPath: *const ::std::os::raw::c_char,
    ) -> *mut pulsar_authentication_t;
}
extern "C" {
    pub fn pulsar_authentication_token_create(
        token: *const ::std::os::raw::c_char,
    ) -> *mut pulsar_authentication_t;
}
extern "C" {
    pub fn pulsar_authentication_token_create_with_supplier(
        tokenSupplier: token_supplier,
        ctx: *mut ::std::os::raw::c_void,
    ) -> *mut pulsar_authentication_t;
}
extern "C" {
    pub fn pulsar_authentication_athenz_create(
        authParamsString: *const ::std::os::raw::c_char,
    ) -> *mut pulsar_authentication_t;
}
extern "C" {
    pub fn pulsar_authentication_oauth2_create(
        authParamsString: *const ::std::os::raw::c_char,
    ) -> *mut pulsar_authentication_t;
}
extern "C" {
    pub fn pulsar_authentication_free(authentication: *mut pulsar_authentication_t);
}