How-To Guides
Flows Guides
Use Access to Write to a Topic
2min
you can use an access publish node to write to a topic through the local message broker by using flows this guide uses the string message hi to write to a topic before you begin make sure you create an access api account see create an api account docid 9yf 3gxvjmo3cbex5eydi and manage api accounts docid 2jhlgd5o9dntorn1vaui for more information make sure you have created a flow to read from a topic see use access to read from a topic docid\ kpmkfjfrbna8hubvy nj2 for more information to write a topic using access in litmus edge, navigate to the flows manager and create a new flow see create a flow docid\ veyyte7xdcangglzbqya0 to learn more drag the access publish and inject nodes to the canvas and wire them together in litmus edge, navigate to system > tokens click the action menu for the api account you created previously and select edit topics from the edit topics dialog box, do the following enter test topic in the write topics field, and click add write topic the topic name appears below the topic name field make sure that there are no spaces in the topic name enter the same topic name( test topic ) in the read topics field, and click add read topic the topic name appears below the topic name field make sure that there are no spaces in the topic name click update return to the flows browser tab and double click the access publish node the edit access publish node dialog box appears topic name paste the topic name test topic you added in the access topic name field click the edit icon next to the access field return to the system > tokens browser tab and do the following click the action menu for the api account you created previously and select view api key click the copy icon next to the api key return to the edit access connect node dialog box in the flows browser tab and do the following api key paste the api key you copied click add or update click done double click the inject node the edit inject node dialog box appears msg payload select the string option from the drop down list and enter hi message in the payload field msg topic enter the name of the write topic ( test topic ) you added in the access write topic field repeat select interval from the drop down list every enter a value for how often to add a message click done drag an access subscribe node to the canvas and wire it to the debug node double click the access subscribe node the edit access subscribe node dialog box appears topic name enter the name of the write topic you added in the access write topic field access from the drop down list, select the access connect you defined in the access publish node click done click deploy expand the message window beneath the flow and click the debug icon click the debug node button to view the output in the debug message window