mosquitto.8 24 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202
  1. '\" t
  2. .\" Title: mosquitto
  3. .\" Author: [see the "Author" section]
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 10/27/2021
  6. .\" Manual: System management commands
  7. .\" Source: Mosquitto Project
  8. .\" Language: English
  9. .\"
  10. .TH "MOSQUITTO" "8" "10/27/2021" "Mosquitto Project" "System management commands"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. mosquitto \- an MQTT broker
  32. .SH "SYNOPSIS"
  33. .HP \w'\fBmosquitto\fR\ 'u
  34. \fBmosquitto\fR [\-c\ \fIconfig\ file\fR] [\-d | \-\-daemon] [\-p\ \fIport\ number\fR] [\-v]
  35. .SH "DESCRIPTION"
  36. .PP
  37. \fBmosquitto\fR
  38. is a broker for the MQTT protocol version 5\&.0/3\&.1\&.1/3\&.1\&.
  39. .SH "OPTIONS"
  40. .PP
  41. \fB\-c\fR, \fB\-\-config\-file\fR
  42. .RS 4
  43. Load configuration from a file\&. If not given, then the broker will listen on port 1883 bound to the loopback interface, and the default values as described in
  44. \fBmosquitto.conf\fR(5)
  45. are used\&.
  46. .if n \{\
  47. .sp
  48. .\}
  49. .RS 4
  50. .it 1 an-trap
  51. .nr an-no-space-flag 1
  52. .nr an-break-flag 1
  53. .br
  54. .ps +1
  55. \fBImportant\fR
  56. .ps -1
  57. .br
  58. See the
  59. \fB\-p\fR
  60. option for a description of changes in behaviour from 1\&.6\&.x to 2\&.0\&.
  61. .sp .5v
  62. .RE
  63. .RE
  64. .PP
  65. \fB\-d\fR, \fB\-\-daemon\fR
  66. .RS 4
  67. Run
  68. \fBmosquitto\fR
  69. in the background as a daemon\&. All other behaviour remains the same\&.
  70. .RE
  71. .PP
  72. \fB\-p\fR, \fB\-\-port\fR
  73. .RS 4
  74. Listen on the port specified\&. May be specified up to 10 times to open multiple sockets listening on different ports\&.
  75. .if n \{\
  76. .sp
  77. .\}
  78. .RS 4
  79. .it 1 an-trap
  80. .nr an-no-space-flag 1
  81. .nr an-break-flag 1
  82. .br
  83. .ps +1
  84. \fBImportant\fR
  85. .ps -1
  86. .br
  87. In version 1\&.6\&.x and earlier, the listener defined by
  88. \fB\-p\fR
  89. (or the default port of 1883) would be bound to all interfaces and so be accessible from any network\&. It could also be used in combination with
  90. \fB\-c\fR\&.
  91. .sp
  92. From version 2\&.0 onwards, the listeners defined with
  93. \fB\-p\fR
  94. are bound to the loopback interface only, and so can only be connected to from the local machine\&. If both
  95. \fB\-p\fR
  96. is used and a listener is defined in a configuration file, then the
  97. \fB\-p\fR
  98. options are IGNORED\&.
  99. .sp .5v
  100. .RE
  101. .RE
  102. .PP
  103. \fB\-v\fR, \fB\-\-verbose\fR
  104. .RS 4
  105. Use verbose logging\&. This is equivalent to setting
  106. \fBlog_type\fR
  107. to
  108. \fBall\fR
  109. in the configuration file\&. This overrides and logging options given in the configuration file\&.
  110. .RE
  111. .SH "CONFIGURATION"
  112. .PP
  113. The broker can be configured using a configuration file as described in
  114. \fBmosquitto.conf\fR(5)
  115. and this is the main point of information for mosquitto\&. The files required for SSL/TLS support are described in
  116. \fBmosquitto-tls\fR(7)\&.
  117. .SH "PLATFORM LIMITATIONS"
  118. .PP
  119. Some versions of Windows have limitations on the number of concurrent connections due to the Windows API being used\&. In modern versions of Windows, e\&.g\&. Windows 10 or Windows Server 2019, this is approximately 8192 connections\&. In earlier versions of Windows, this limit is 2048 connections\&.
  120. .SH "MQTT SUPPORT"
  121. .PP
  122. Mosquitto supports MQTT v5\&.0, v3\&.1\&.1, and v3\&.1\&.
  123. .SS "MQTT v5\&.0"
  124. .PP
  125. Mosquitto provides full MQTT v5\&.0 support, but some features are not used directly\&. The following sections describe the new features and explain where Mosquitto does not make use of a feature\&.
  126. .sp
  127. .it 1 an-trap
  128. .nr an-no-space-flag 1
  129. .nr an-break-flag 1
  130. .br
  131. .ps +1
  132. \fBFeatures\fR
  133. .RS 4
  134. .PP
  135. \fBEnhanced authentication\fR
  136. .RS 4
  137. Basic MQTT authentication uses username/password checks\&. Enhanced authentication allows different authentication schemes to be integrated into MQTT, and even those schemes with multiple step processes\&. Clients request a particular type of authentication and if the broker is configured for that scheme the authentication continues\&. Mosquitto supports enhanced authentication through plugins\&.
  138. .RE
  139. .PP
  140. \fBError handling\fR
  141. .RS 4
  142. Most MQTT packets now have the concept of a
  143. \fBreason code\fR
  144. which indicates success or failure, and what the failure was\&. Mosquitto provides full support for reason codes, but does not make use of the
  145. \fBreason string\fR
  146. feature which can be used to provide a human readable error string to explain the reason code\&.
  147. .RE
  148. .PP
  149. \fBFlow control\fR
  150. .RS 4
  151. The number of "in flight" messages for QoS 1 and QoS 2 can be controlled by both the client and the broker\&.
  152. .RE
  153. .PP
  154. \fBRequest / response\fR
  155. .RS 4
  156. MQTT v5\&.0 adds a request/response pattern that allows a client to publish a message and instruct the subscribers of that message where to publish a response\&.
  157. .RE
  158. .PP
  159. \fBServer redirection\fR
  160. .RS 4
  161. Server redirection is the concept of telling a client to connect to a different MQTT broker, either on CONNECT or with a broker initiated DISCONNECT\&. Mosquitto does not currently make use of this feature\&.
  162. .RE
  163. .PP
  164. \fBShared subscriptions\fR
  165. .RS 4
  166. When multiple clients subscribe to the same shared subscription, only one client out of the group will receive each message which allows for distributing work loads\&.
  167. .RE
  168. .RE
  169. .sp
  170. .it 1 an-trap
  171. .nr an-no-space-flag 1
  172. .nr an-break-flag 1
  173. .br
  174. .ps +1
  175. \fBPacket properties\fR
  176. .RS 4
  177. .PP
  178. MQTT v5\&.0 allows properties to be added to packets to control certain behaviour\&. Unless noted, Mosquitto support the properties listed below\&.
  179. .PP
  180. \fBCONNECT\fR
  181. .RS 4
  182. .sp
  183. .RS 4
  184. .ie n \{\
  185. \h'-04'\(bu\h'+03'\c
  186. .\}
  187. .el \{\
  188. .sp -1
  189. .IP \(bu 2.3
  190. .\}
  191. Authentication data
  192. .RE
  193. .sp
  194. .RS 4
  195. .ie n \{\
  196. \h'-04'\(bu\h'+03'\c
  197. .\}
  198. .el \{\
  199. .sp -1
  200. .IP \(bu 2.3
  201. .\}
  202. Authentication method
  203. .RE
  204. .sp
  205. .RS 4
  206. .ie n \{\
  207. \h'-04'\(bu\h'+03'\c
  208. .\}
  209. .el \{\
  210. .sp -1
  211. .IP \(bu 2.3
  212. .\}
  213. Maximum packet size
  214. .RE
  215. .sp
  216. .RS 4
  217. .ie n \{\
  218. \h'-04'\(bu\h'+03'\c
  219. .\}
  220. .el \{\
  221. .sp -1
  222. .IP \(bu 2.3
  223. .\}
  224. Receive maximum
  225. .RE
  226. .sp
  227. .RS 4
  228. .ie n \{\
  229. \h'-04'\(bu\h'+03'\c
  230. .\}
  231. .el \{\
  232. .sp -1
  233. .IP \(bu 2.3
  234. .\}
  235. Request problem information \- supported but not used
  236. .RE
  237. .sp
  238. .RS 4
  239. .ie n \{\
  240. \h'-04'\(bu\h'+03'\c
  241. .\}
  242. .el \{\
  243. .sp -1
  244. .IP \(bu 2.3
  245. .\}
  246. Request response information \- supported but not used
  247. .RE
  248. .sp
  249. .RS 4
  250. .ie n \{\
  251. \h'-04'\(bu\h'+03'\c
  252. .\}
  253. .el \{\
  254. .sp -1
  255. .IP \(bu 2.3
  256. .\}
  257. Session expiry interval
  258. .RE
  259. .sp
  260. .RS 4
  261. .ie n \{\
  262. \h'-04'\(bu\h'+03'\c
  263. .\}
  264. .el \{\
  265. .sp -1
  266. .IP \(bu 2.3
  267. .\}
  268. Topic alias maximum
  269. .RE
  270. .sp
  271. .RS 4
  272. .ie n \{\
  273. \h'-04'\(bu\h'+03'\c
  274. .\}
  275. .el \{\
  276. .sp -1
  277. .IP \(bu 2.3
  278. .\}
  279. User property
  280. .RE
  281. .RE
  282. .PP
  283. \fBLast will and testament\fR
  284. .RS 4
  285. .sp
  286. .RS 4
  287. .ie n \{\
  288. \h'-04'\(bu\h'+03'\c
  289. .\}
  290. .el \{\
  291. .sp -1
  292. .IP \(bu 2.3
  293. .\}
  294. Content type
  295. .RE
  296. .sp
  297. .RS 4
  298. .ie n \{\
  299. \h'-04'\(bu\h'+03'\c
  300. .\}
  301. .el \{\
  302. .sp -1
  303. .IP \(bu 2.3
  304. .\}
  305. Correlation data
  306. .RE
  307. .sp
  308. .RS 4
  309. .ie n \{\
  310. \h'-04'\(bu\h'+03'\c
  311. .\}
  312. .el \{\
  313. .sp -1
  314. .IP \(bu 2.3
  315. .\}
  316. Message expiry interval
  317. .RE
  318. .sp
  319. .RS 4
  320. .ie n \{\
  321. \h'-04'\(bu\h'+03'\c
  322. .\}
  323. .el \{\
  324. .sp -1
  325. .IP \(bu 2.3
  326. .\}
  327. Payload format indicator
  328. .RE
  329. .sp
  330. .RS 4
  331. .ie n \{\
  332. \h'-04'\(bu\h'+03'\c
  333. .\}
  334. .el \{\
  335. .sp -1
  336. .IP \(bu 2.3
  337. .\}
  338. Response topic
  339. .RE
  340. .sp
  341. .RS 4
  342. .ie n \{\
  343. \h'-04'\(bu\h'+03'\c
  344. .\}
  345. .el \{\
  346. .sp -1
  347. .IP \(bu 2.3
  348. .\}
  349. User property
  350. .RE
  351. .sp
  352. .RS 4
  353. .ie n \{\
  354. \h'-04'\(bu\h'+03'\c
  355. .\}
  356. .el \{\
  357. .sp -1
  358. .IP \(bu 2.3
  359. .\}
  360. Will delay interval
  361. .RE
  362. .RE
  363. .PP
  364. \fBCONNACK\fR
  365. .RS 4
  366. .sp
  367. .RS 4
  368. .ie n \{\
  369. \h'-04'\(bu\h'+03'\c
  370. .\}
  371. .el \{\
  372. .sp -1
  373. .IP \(bu 2.3
  374. .\}
  375. Assigned client identifier
  376. .RE
  377. .sp
  378. .RS 4
  379. .ie n \{\
  380. \h'-04'\(bu\h'+03'\c
  381. .\}
  382. .el \{\
  383. .sp -1
  384. .IP \(bu 2.3
  385. .\}
  386. Authentication data
  387. .RE
  388. .sp
  389. .RS 4
  390. .ie n \{\
  391. \h'-04'\(bu\h'+03'\c
  392. .\}
  393. .el \{\
  394. .sp -1
  395. .IP \(bu 2.3
  396. .\}
  397. Authentication method
  398. .RE
  399. .sp
  400. .RS 4
  401. .ie n \{\
  402. \h'-04'\(bu\h'+03'\c
  403. .\}
  404. .el \{\
  405. .sp -1
  406. .IP \(bu 2.3
  407. .\}
  408. Maximum packet size
  409. .RE
  410. .sp
  411. .RS 4
  412. .ie n \{\
  413. \h'-04'\(bu\h'+03'\c
  414. .\}
  415. .el \{\
  416. .sp -1
  417. .IP \(bu 2.3
  418. .\}
  419. Maximum qos
  420. .RE
  421. .sp
  422. .RS 4
  423. .ie n \{\
  424. \h'-04'\(bu\h'+03'\c
  425. .\}
  426. .el \{\
  427. .sp -1
  428. .IP \(bu 2.3
  429. .\}
  430. Reason string \- supported but not used
  431. .RE
  432. .sp
  433. .RS 4
  434. .ie n \{\
  435. \h'-04'\(bu\h'+03'\c
  436. .\}
  437. .el \{\
  438. .sp -1
  439. .IP \(bu 2.3
  440. .\}
  441. Receive maximum
  442. .RE
  443. .sp
  444. .RS 4
  445. .ie n \{\
  446. \h'-04'\(bu\h'+03'\c
  447. .\}
  448. .el \{\
  449. .sp -1
  450. .IP \(bu 2.3
  451. .\}
  452. Response information \- supported but not used
  453. .RE
  454. .sp
  455. .RS 4
  456. .ie n \{\
  457. \h'-04'\(bu\h'+03'\c
  458. .\}
  459. .el \{\
  460. .sp -1
  461. .IP \(bu 2.3
  462. .\}
  463. Retain available
  464. .RE
  465. .sp
  466. .RS 4
  467. .ie n \{\
  468. \h'-04'\(bu\h'+03'\c
  469. .\}
  470. .el \{\
  471. .sp -1
  472. .IP \(bu 2.3
  473. .\}
  474. Server keep alive
  475. .RE
  476. .sp
  477. .RS 4
  478. .ie n \{\
  479. \h'-04'\(bu\h'+03'\c
  480. .\}
  481. .el \{\
  482. .sp -1
  483. .IP \(bu 2.3
  484. .\}
  485. Server reference \- supported but not used
  486. .RE
  487. .sp
  488. .RS 4
  489. .ie n \{\
  490. \h'-04'\(bu\h'+03'\c
  491. .\}
  492. .el \{\
  493. .sp -1
  494. .IP \(bu 2.3
  495. .\}
  496. Session expiry interval
  497. .RE
  498. .sp
  499. .RS 4
  500. .ie n \{\
  501. \h'-04'\(bu\h'+03'\c
  502. .\}
  503. .el \{\
  504. .sp -1
  505. .IP \(bu 2.3
  506. .\}
  507. Shared subscription available
  508. .RE
  509. .sp
  510. .RS 4
  511. .ie n \{\
  512. \h'-04'\(bu\h'+03'\c
  513. .\}
  514. .el \{\
  515. .sp -1
  516. .IP \(bu 2.3
  517. .\}
  518. Subscription identifiers available
  519. .RE
  520. .sp
  521. .RS 4
  522. .ie n \{\
  523. \h'-04'\(bu\h'+03'\c
  524. .\}
  525. .el \{\
  526. .sp -1
  527. .IP \(bu 2.3
  528. .\}
  529. Topic alias maximum
  530. .RE
  531. .sp
  532. .RS 4
  533. .ie n \{\
  534. \h'-04'\(bu\h'+03'\c
  535. .\}
  536. .el \{\
  537. .sp -1
  538. .IP \(bu 2.3
  539. .\}
  540. User property
  541. .RE
  542. .sp
  543. .RS 4
  544. .ie n \{\
  545. \h'-04'\(bu\h'+03'\c
  546. .\}
  547. .el \{\
  548. .sp -1
  549. .IP \(bu 2.3
  550. .\}
  551. Wildcard subscription available
  552. .RE
  553. .RE
  554. .PP
  555. \fBPUBLISH\fR
  556. .RS 4
  557. .sp
  558. .RS 4
  559. .ie n \{\
  560. \h'-04'\(bu\h'+03'\c
  561. .\}
  562. .el \{\
  563. .sp -1
  564. .IP \(bu 2.3
  565. .\}
  566. Content type
  567. .RE
  568. .sp
  569. .RS 4
  570. .ie n \{\
  571. \h'-04'\(bu\h'+03'\c
  572. .\}
  573. .el \{\
  574. .sp -1
  575. .IP \(bu 2.3
  576. .\}
  577. Correlation data
  578. .RE
  579. .sp
  580. .RS 4
  581. .ie n \{\
  582. \h'-04'\(bu\h'+03'\c
  583. .\}
  584. .el \{\
  585. .sp -1
  586. .IP \(bu 2.3
  587. .\}
  588. Message expiry interval
  589. .RE
  590. .sp
  591. .RS 4
  592. .ie n \{\
  593. \h'-04'\(bu\h'+03'\c
  594. .\}
  595. .el \{\
  596. .sp -1
  597. .IP \(bu 2.3
  598. .\}
  599. Payload format indicator
  600. .RE
  601. .sp
  602. .RS 4
  603. .ie n \{\
  604. \h'-04'\(bu\h'+03'\c
  605. .\}
  606. .el \{\
  607. .sp -1
  608. .IP \(bu 2.3
  609. .\}
  610. Response topic
  611. .RE
  612. .sp
  613. .RS 4
  614. .ie n \{\
  615. \h'-04'\(bu\h'+03'\c
  616. .\}
  617. .el \{\
  618. .sp -1
  619. .IP \(bu 2.3
  620. .\}
  621. Subscription identifier
  622. .RE
  623. .sp
  624. .RS 4
  625. .ie n \{\
  626. \h'-04'\(bu\h'+03'\c
  627. .\}
  628. .el \{\
  629. .sp -1
  630. .IP \(bu 2.3
  631. .\}
  632. Topic alias
  633. .RE
  634. .sp
  635. .RS 4
  636. .ie n \{\
  637. \h'-04'\(bu\h'+03'\c
  638. .\}
  639. .el \{\
  640. .sp -1
  641. .IP \(bu 2.3
  642. .\}
  643. User property
  644. .RE
  645. .RE
  646. .PP
  647. \fBPUBACK / PUBREC / PUBREL / PUBCOMP / SUBACK / SUBSCRIBE / SUBACK\fR
  648. .RS 4
  649. .sp
  650. .RS 4
  651. .ie n \{\
  652. \h'-04'\(bu\h'+03'\c
  653. .\}
  654. .el \{\
  655. .sp -1
  656. .IP \(bu 2.3
  657. .\}
  658. Reason string \- supported but not used
  659. .RE
  660. .sp
  661. .RS 4
  662. .ie n \{\
  663. \h'-04'\(bu\h'+03'\c
  664. .\}
  665. .el \{\
  666. .sp -1
  667. .IP \(bu 2.3
  668. .\}
  669. User property
  670. .RE
  671. .RE
  672. .PP
  673. \fBSUBSCRIBE\fR
  674. .RS 4
  675. .sp
  676. .RS 4
  677. .ie n \{\
  678. \h'-04'\(bu\h'+03'\c
  679. .\}
  680. .el \{\
  681. .sp -1
  682. .IP \(bu 2.3
  683. .\}
  684. Subscription identifier
  685. .RE
  686. .sp
  687. .RS 4
  688. .ie n \{\
  689. \h'-04'\(bu\h'+03'\c
  690. .\}
  691. .el \{\
  692. .sp -1
  693. .IP \(bu 2.3
  694. .\}
  695. User property
  696. .RE
  697. .RE
  698. .PP
  699. \fBDISCONNECT\fR
  700. .RS 4
  701. .sp
  702. .RS 4
  703. .ie n \{\
  704. \h'-04'\(bu\h'+03'\c
  705. .\}
  706. .el \{\
  707. .sp -1
  708. .IP \(bu 2.3
  709. .\}
  710. Reason string \- supported but not used
  711. .RE
  712. .sp
  713. .RS 4
  714. .ie n \{\
  715. \h'-04'\(bu\h'+03'\c
  716. .\}
  717. .el \{\
  718. .sp -1
  719. .IP \(bu 2.3
  720. .\}
  721. Server reference \- supported but not used
  722. .RE
  723. .sp
  724. .RS 4
  725. .ie n \{\
  726. \h'-04'\(bu\h'+03'\c
  727. .\}
  728. .el \{\
  729. .sp -1
  730. .IP \(bu 2.3
  731. .\}
  732. Session expiry interval
  733. .RE
  734. .sp
  735. .RS 4
  736. .ie n \{\
  737. \h'-04'\(bu\h'+03'\c
  738. .\}
  739. .el \{\
  740. .sp -1
  741. .IP \(bu 2.3
  742. .\}
  743. User property
  744. .RE
  745. .RE
  746. .PP
  747. \fBAUTH\fR
  748. .RS 4
  749. .sp
  750. .RS 4
  751. .ie n \{\
  752. \h'-04'\(bu\h'+03'\c
  753. .\}
  754. .el \{\
  755. .sp -1
  756. .IP \(bu 2.3
  757. .\}
  758. Authentication method
  759. .RE
  760. .sp
  761. .RS 4
  762. .ie n \{\
  763. \h'-04'\(bu\h'+03'\c
  764. .\}
  765. .el \{\
  766. .sp -1
  767. .IP \(bu 2.3
  768. .\}
  769. Authentication data
  770. .RE
  771. .sp
  772. .RS 4
  773. .ie n \{\
  774. \h'-04'\(bu\h'+03'\c
  775. .\}
  776. .el \{\
  777. .sp -1
  778. .IP \(bu 2.3
  779. .\}
  780. Reason string \- supported but not used
  781. .RE
  782. .sp
  783. .RS 4
  784. .ie n \{\
  785. \h'-04'\(bu\h'+03'\c
  786. .\}
  787. .el \{\
  788. .sp -1
  789. .IP \(bu 2.3
  790. .\}
  791. User property
  792. .RE
  793. .RE
  794. .RE
  795. .SS "MQTT v3\&.1\&.1"
  796. .PP
  797. Mosquitto provides full MQTT v3\&.1\&.1 support\&.
  798. .SS "MQTT v3\&.1"
  799. .PP
  800. Mosquitto provides full MQTT v3\&.1 support\&.
  801. .SS "MQTT v3"
  802. .PP
  803. MQTT v3 is an obsolete version of the protocol that does not support username/password authentication and used the
  804. \fBclean start\fR
  805. flag in the CONNECT packet which applied only to the start of a session\&. An MQTT v3 client will be able to successfully connect to a Mosquitto instance that does not require authentication\&.
  806. .SH "BROKER STATUS"
  807. .PP
  808. Clients can find information about the broker by subscribing to topics in the $SYS hierarchy as follows\&. Topics marked as static are only sent once per client on subscription\&. All other topics are updated every
  809. \fBsys_interval\fR
  810. seconds\&. If
  811. \fBsys_interval\fR
  812. is 0, then updates are not sent\&.
  813. .PP
  814. Note that if you are using a command line client to interact with the $SYS topics and your shell interprets $ as an environment variable, you need to place the topic in single quotes \*(Aq$SYS/\&.\&.\&.\*(Aq or to escape the dollar symbol: \e$SYS/\&.\&.\&. otherwise the $SYS will be treated as an environment variable\&.
  815. .PP
  816. \fB$SYS/broker/bytes/received\fR
  817. .RS 4
  818. The total number of bytes received since the broker started\&.
  819. .RE
  820. .PP
  821. \fB$SYS/broker/bytes/sent\fR
  822. .RS 4
  823. The total number of bytes sent since the broker started\&.
  824. .RE
  825. .PP
  826. \fB$SYS/broker/clients/connected\fR, \fB$SYS/broker/clients/active\fR (deprecated)
  827. .RS 4
  828. The number of currently connected clients\&.
  829. .RE
  830. .PP
  831. \fB$SYS/broker/clients/expired\fR
  832. .RS 4
  833. The number of disconnected persistent clients that have been expired and removed through the persistent_client_expiration option\&.
  834. .RE
  835. .PP
  836. \fB$SYS/broker/clients/disconnected\fR, \fB$SYS/broker/clients/inactive\fR (deprecated)
  837. .RS 4
  838. The total number of persistent clients (with clean session disabled) that are registered at the broker but are currently disconnected\&.
  839. .RE
  840. .PP
  841. \fB$SYS/broker/clients/maximum\fR
  842. .RS 4
  843. The maximum number of clients that have been connected to the broker at the same time\&.
  844. .RE
  845. .PP
  846. \fB$SYS/broker/clients/total\fR
  847. .RS 4
  848. The total number of active and inactive clients currently connected and registered on the broker\&.
  849. .RE
  850. .PP
  851. \fB$SYS/broker/connection/#\fR
  852. .RS 4
  853. When bridges are configured to/from the broker, common practice is to provide a status topic that indicates the state of the connection\&. This is provided within $SYS/broker/connection/ by default\&. If the value of the topic is 1 the connection is active, if 0 then it is not active\&. See the Bridges section below for more information on bridges\&.
  854. .RE
  855. .PP
  856. \fB$SYS/broker/heap/current size\fR
  857. .RS 4
  858. The current size of the heap memory in use by mosquitto\&. Note that this topic may be unavailable depending on compile time options\&.
  859. .RE
  860. .PP
  861. \fB$SYS/broker/heap/maximum size\fR
  862. .RS 4
  863. The largest amount of heap memory used by mosquitto\&. Note that this topic may be unavailable depending on compile time options\&.
  864. .RE
  865. .PP
  866. \fB$SYS/broker/load/connections/+\fR
  867. .RS 4
  868. The moving average of the number of CONNECT packets received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of connections received in 1 minute, averaged over 1, 5 or 15 minutes\&.
  869. .RE
  870. .PP
  871. \fB$SYS/broker/load/bytes/received/+\fR
  872. .RS 4
  873. The moving average of the number of bytes received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of bytes received in 1 minute, averaged over 1, 5 or 15 minutes\&.
  874. .RE
  875. .PP
  876. \fB$SYS/broker/load/bytes/sent/+\fR
  877. .RS 4
  878. The moving average of the number of bytes sent by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of bytes sent in 1 minute, averaged over 1, 5 or 15 minutes\&.
  879. .RE
  880. .PP
  881. \fB$SYS/broker/load/messages/received/+\fR
  882. .RS 4
  883. The moving average of the number of all types of MQTT messages received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of messages received in 1 minute, averaged over 1, 5 or 15 minutes\&.
  884. .RE
  885. .PP
  886. \fB$SYS/broker/load/messages/sent/+\fR
  887. .RS 4
  888. The moving average of the number of all types of MQTT messages sent by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of messages send in 1 minute, averaged over 1, 5 or 15 minutes\&.
  889. .RE
  890. .PP
  891. \fB$SYS/broker/load/publish/dropped/+\fR
  892. .RS 4
  893. The moving average of the number of publish messages dropped by the broker over different time intervals\&. This shows the rate at which durable clients that are disconnected are losing messages\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of messages dropped in 1 minute, averaged over 1, 5 or 15 minutes\&.
  894. .RE
  895. .PP
  896. \fB$SYS/broker/load/publish/received/+\fR
  897. .RS 4
  898. The moving average of the number of publish messages received by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of publish messages received in 1 minute, averaged over 1, 5 or 15 minutes\&.
  899. .RE
  900. .PP
  901. \fB$SYS/broker/load/publish/sent/+\fR
  902. .RS 4
  903. The moving average of the number of publish messages sent by the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of publish messages sent in 1 minute, averaged over 1, 5 or 15 minutes\&.
  904. .RE
  905. .PP
  906. \fB$SYS/broker/load/sockets/+\fR
  907. .RS 4
  908. The moving average of the number of socket connections opened to the broker over different time intervals\&. The final "+" of the hierarchy can be 1min, 5min or 15min\&. The value returned represents the number of socket connections in 1 minute, averaged over 1, 5 or 15 minutes\&.
  909. .RE
  910. .PP
  911. \fB$SYS/broker/messages/inflight\fR
  912. .RS 4
  913. The number of messages with QoS>0 that are awaiting acknowledgments\&.
  914. .RE
  915. .PP
  916. \fB$SYS/broker/messages/received\fR
  917. .RS 4
  918. The total number of messages of any type received since the broker started\&.
  919. .RE
  920. .PP
  921. \fB$SYS/broker/messages/sent\fR
  922. .RS 4
  923. The total number of messages of any type sent since the broker started\&.
  924. .RE
  925. .PP
  926. \fB$SYS/broker/publish/messages/dropped\fR
  927. .RS 4
  928. The total number of publish messages that have been dropped due to inflight/queuing limits\&. See the max_inflight_messages and max_queued_messages options in
  929. \fBmosquitto.conf\fR(5)
  930. for more information\&.
  931. .RE
  932. .PP
  933. \fB$SYS/broker/publish/messages/received\fR
  934. .RS 4
  935. The total number of PUBLISH messages received since the broker started\&.
  936. .RE
  937. .PP
  938. \fB$SYS/broker/publish/messages/sent\fR
  939. .RS 4
  940. The total number of PUBLISH messages sent since the broker started\&.
  941. .RE
  942. .PP
  943. \fB$SYS/broker/retained messages/count\fR
  944. .RS 4
  945. The total number of retained messages active on the broker\&.
  946. .RE
  947. .PP
  948. \fB$SYS/broker/store/messages/count\fR, \fB$SYS/broker/messages/stored\fR (deprecated)
  949. .RS 4
  950. The number of messages currently held in the message store\&. This includes retained messages and messages queued for durable clients\&.
  951. .RE
  952. .PP
  953. \fB$SYS/broker/store/messages/bytes\fR
  954. .RS 4
  955. The number of bytes currently held by message payloads in the message store\&. This includes retained messages and messages queued for durable clients\&.
  956. .RE
  957. .PP
  958. \fB$SYS/broker/subscriptions/count\fR
  959. .RS 4
  960. The total number of subscriptions active on the broker\&.
  961. .RE
  962. .PP
  963. \fB$SYS/broker/version\fR
  964. .RS 4
  965. The version of the broker\&. Static\&.
  966. .RE
  967. .SH "WILDCARD TOPIC SUBSCRIPTIONS"
  968. .PP
  969. In addition to allowing clients to subscribe to specific topics, mosquitto also allows the use of two wildcards in subscriptions\&.
  970. \fB+\fR
  971. is the wildcard used to match a single level of hierarchy\&. For example, for a topic of "a/b/c/d", the following example subscriptions will match:
  972. .sp
  973. .RS 4
  974. .ie n \{\
  975. \h'-04'\(bu\h'+03'\c
  976. .\}
  977. .el \{\
  978. .sp -1
  979. .IP \(bu 2.3
  980. .\}
  981. a/b/c/d
  982. .RE
  983. .sp
  984. .RS 4
  985. .ie n \{\
  986. \h'-04'\(bu\h'+03'\c
  987. .\}
  988. .el \{\
  989. .sp -1
  990. .IP \(bu 2.3
  991. .\}
  992. +/b/c/d
  993. .RE
  994. .sp
  995. .RS 4
  996. .ie n \{\
  997. \h'-04'\(bu\h'+03'\c
  998. .\}
  999. .el \{\
  1000. .sp -1
  1001. .IP \(bu 2.3
  1002. .\}
  1003. a/+/c/d
  1004. .RE
  1005. .sp
  1006. .RS 4
  1007. .ie n \{\
  1008. \h'-04'\(bu\h'+03'\c
  1009. .\}
  1010. .el \{\
  1011. .sp -1
  1012. .IP \(bu 2.3
  1013. .\}
  1014. a/+/+/d
  1015. .RE
  1016. .sp
  1017. .RS 4
  1018. .ie n \{\
  1019. \h'-04'\(bu\h'+03'\c
  1020. .\}
  1021. .el \{\
  1022. .sp -1
  1023. .IP \(bu 2.3
  1024. .\}
  1025. +/+/+/+
  1026. .RE
  1027. .PP
  1028. The following subscriptions will not match:
  1029. .sp
  1030. .RS 4
  1031. .ie n \{\
  1032. \h'-04'\(bu\h'+03'\c
  1033. .\}
  1034. .el \{\
  1035. .sp -1
  1036. .IP \(bu 2.3
  1037. .\}
  1038. a/b/c
  1039. .RE
  1040. .sp
  1041. .RS 4
  1042. .ie n \{\
  1043. \h'-04'\(bu\h'+03'\c
  1044. .\}
  1045. .el \{\
  1046. .sp -1
  1047. .IP \(bu 2.3
  1048. .\}
  1049. b/+/c/d
  1050. .RE
  1051. .sp
  1052. .RS 4
  1053. .ie n \{\
  1054. \h'-04'\(bu\h'+03'\c
  1055. .\}
  1056. .el \{\
  1057. .sp -1
  1058. .IP \(bu 2.3
  1059. .\}
  1060. +/+/+
  1061. .RE
  1062. .PP
  1063. The second wildcard is
  1064. \fB#\fR
  1065. and is used to match all subsequent levels of hierarchy\&. With a topic of "a/b/c/d", the following example subscriptions will match:
  1066. .sp
  1067. .RS 4
  1068. .ie n \{\
  1069. \h'-04'\(bu\h'+03'\c
  1070. .\}
  1071. .el \{\
  1072. .sp -1
  1073. .IP \(bu 2.3
  1074. .\}
  1075. a/b/c/d
  1076. .RE
  1077. .sp
  1078. .RS 4
  1079. .ie n \{\
  1080. \h'-04'\(bu\h'+03'\c
  1081. .\}
  1082. .el \{\
  1083. .sp -1
  1084. .IP \(bu 2.3
  1085. .\}
  1086. #
  1087. .RE
  1088. .sp
  1089. .RS 4
  1090. .ie n \{\
  1091. \h'-04'\(bu\h'+03'\c
  1092. .\}
  1093. .el \{\
  1094. .sp -1
  1095. .IP \(bu 2.3
  1096. .\}
  1097. a/#
  1098. .RE
  1099. .sp
  1100. .RS 4
  1101. .ie n \{\
  1102. \h'-04'\(bu\h'+03'\c
  1103. .\}
  1104. .el \{\
  1105. .sp -1
  1106. .IP \(bu 2.3
  1107. .\}
  1108. a/b/#
  1109. .RE
  1110. .sp
  1111. .RS 4
  1112. .ie n \{\
  1113. \h'-04'\(bu\h'+03'\c
  1114. .\}
  1115. .el \{\
  1116. .sp -1
  1117. .IP \(bu 2.3
  1118. .\}
  1119. a/b/c/#
  1120. .RE
  1121. .sp
  1122. .RS 4
  1123. .ie n \{\
  1124. \h'-04'\(bu\h'+03'\c
  1125. .\}
  1126. .el \{\
  1127. .sp -1
  1128. .IP \(bu 2.3
  1129. .\}
  1130. +/b/c/#
  1131. .RE
  1132. .PP
  1133. The $SYS hierarchy does not match a subscription of "#"\&. If you want to observe the entire $SYS hierarchy, subscribe to $SYS/#\&.
  1134. .PP
  1135. Note that the wildcards must be only ever used on their own, so a subscription of "a/b+/c" is not valid use of a wildcard\&. The
  1136. \fB#\fR
  1137. wildcard must only ever be used as the final character of a subscription\&.
  1138. .SH "BRIDGES"
  1139. .PP
  1140. Multiple brokers can be connected together with the bridging functionality\&. This is useful where it is desirable to share information between locations, but where not all of the information needs to be shared\&. An example could be where a number of users are running a broker to help record power usage and for a number of other reasons\&. The power usage could be shared through bridging all of the user brokers to a common broker, allowing the power usage of all users to be collected and compared\&. The other information would remain local to each broker\&.
  1141. .PP
  1142. For information on configuring bridges, see
  1143. \fBmosquitto.conf\fR(5)\&.
  1144. .SH "SIGNALS"
  1145. .PP
  1146. On POSIX systems Mosquitto can receive signals and act on them as described below\&. To send signals, use e\&.g\&.
  1147. \fBkill \-HUP <process id of mosquitto>\fR
  1148. .PP
  1149. SIGHUP
  1150. .RS 4
  1151. Upon receiving the SIGHUP signal, mosquitto will attempt to reload configuration file data, assuming that the
  1152. \fB\-c\fR
  1153. argument was provided when mosquitto was started\&. Not all configuration parameters can be reloaded without restarting\&. See
  1154. \fBmosquitto.conf\fR(5)
  1155. for details\&.
  1156. .sp
  1157. If TLS certificates are in use, then mosquitto will also reload certificate on receiving a SIGHUP\&.
  1158. .RE
  1159. .PP
  1160. SIGUSR1
  1161. .RS 4
  1162. Upon receiving the SIGUSR1 signal, mosquitto will write the persistence database to disk\&. This signal is only acted upon if persistence is enabled\&.
  1163. .RE
  1164. .PP
  1165. SIGUSR2
  1166. .RS 4
  1167. The SIGUSR2 signal causes mosquitto to print out the current subscription tree, along with information about where retained messages exist\&. This is intended as a testing feature only and may be removed at any time\&.
  1168. .RE
  1169. .SH "FILES"
  1170. .PP
  1171. /etc/mosquitto/mosquitto\&.conf
  1172. .RS 4
  1173. Configuration file\&. See
  1174. \fBmosquitto.conf\fR(5)\&.
  1175. .RE
  1176. .PP
  1177. /var/lib/mosquitto/mosquitto\&.db
  1178. .RS 4
  1179. Persistent message data storage location if persist enabled\&.
  1180. .RE
  1181. .PP
  1182. /etc/hosts\&.allow, /etc/hosts\&.deny
  1183. .RS 4
  1184. Host access control via tcp\-wrappers as described in
  1185. \fBhosts_access\fR(5)\&.
  1186. .RE
  1187. .SH "BUGS"
  1188. .PP
  1189. \fBmosquitto\fR
  1190. bug information can be found at
  1191. \m[blue]\fB\%https://github.com/eclipse/mosquitto/issues\fR\m[]
  1192. .SH "SEE ALSO"
  1193. \fBmqtt\fR(7), \fBmosquitto-tls\fR(7), \fBmosquitto.conf\fR(5), \fBhosts_access\fR(5), \fBmosquitto_ctrl\fR(1), \fBmosquitto_passwd\fR(1), \fBmosquitto_pub\fR(1), \fBmosquitto_rr\fR(1), \fBmosquitto_sub\fR(1), \fBlibmosquitto\fR(3)
  1194. .SH "THANKS"
  1195. .PP
  1196. Thanks to Andy Stanford\-Clark for being one of the people who came up with MQTT in the first place\&. Thanks to Andy and Nicholas O\*(AqLeary for providing clarifications of the protocol\&.
  1197. .PP
  1198. Thanks also to everybody at the Ubuntu UK Podcast and Linux Outlaws for organising OggCamp, where Andy gave a talk that inspired mosquitto\&.
  1199. .SH "AUTHOR"
  1200. .PP
  1201. Roger Light
  1202. <roger@atchoo\&.org>