Electronic commerce technology offers the opportunity to integrate and optimize the global production and distribution on supply chain. Computers of various corporations, located throughout the world, communicate with each other to determine the availability of components, to place and confirm orders, and to negotiate delivery timescales. Software agents help to automate a variety of tasks including those involved in buying and selling products over the Internet. This paper presents MAPSEC, an e-commerce system based on mobile agents, that uses publish/subscribe protocol for registration and transaction processes. In this system, (as in a large-scale and dynamic environment) there can be any number of buyers and suppliers. Any supplier can connect, register or unregister to the system at any time, thus preserving the dynamic structure of the system.